Class AutoPublisher<T>
Abstract PublisherBehaviour<T> that automatically publishes messages at a configurable rate.
Inherited Members
Object.GetEntityId()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Namespace: Unity.SimulationPro.Foundation
Assembly: Unity.SimulationPro.Foundation.dll
Syntax
public abstract class AutoPublisher<T> : PublisherBehaviour<T> where T : IMessage
Type Parameters
| Name | Description |
|---|---|
| T | The IMessage type this component publishes. |
Remarks
Override CreateMessage() to return the message to publish each interval. The base class handles timing and calls Publish(T) for you.
Properties
PublishFrequency
Gets or sets the number of messages published per second.
Declaration
public float PublishFrequency { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
PublishInFixedUpdate
Gets or sets a value indicating whether publishing occurs in FixedUpdate instead of Update.
Declaration
public bool PublishInFixedUpdate { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
CreateMessage()
Creates the message to publish for the current interval.
Declaration
protected abstract T CreateMessage()
Returns
| Type | Description |
|---|---|
| T | The message instance to send. |
FixedUpdate()
Fixed Update.
Declaration
protected void FixedUpdate()
Update()
Update.
Declaration
protected virtual void Update()