SyncedEventBaseT Class

Base class for syncronizing events with any type of argument.

Definition

Namespace: Alteruna
Assembly: Alteruna.Trinity (in Alteruna.Trinity.dll) Version: 1.3.4
C#
public class SyncedEventBase<T> : Synchronizable
Inheritance
Object    Object    Component    Behaviour    MonoBehaviour    CommunicationBridge    CommunicationBridgeUID    Synchronizable    SyncedEventBaseT

Type Parameters

T
Type of the argument that is passed in the event.

Remarks

Cannot be used as a compoment but can be inherited to create any type of SyncedEvent. To sync an event with no arguments, Synced Event <Void>.

Example

You can create a new SyncedEvent of any type by inheriting from SyncedEventBase. Here is an example of creating a SyncedEvent for int64 (long).
C#
// Create a new SyncedEvent of given type by inheriting from SyncedEventBase.
public class SyncedEventLong : Alteruna.SyncedEventBase<long> { }

Properties

HaveBeenInvoked True if the event has been invoked previously.
LastValue Last value used in the event.

Methods

AssembleData
(Overrides SynchronizableAssembleData(Writer, Byte))
DisassembleData
(Overrides SynchronizableDisassembleData(Reader, Byte))
Invoke Invoke the event with the last used argument.
Invoke(T) Invoke the event with the given argument.
InvokeSilent Invoke without triggering local event with the last used argument.
InvokeSilent(T) Invoke without triggering local event with the given argument.
Reset 
ValueToString Get the last used argument as string.

Fields

OnEvent Event to be invoked.
Value Last value used in the event.

See Also