Class MessageType
Base class for all MessageTypes without parameter.
Namespace: MalteHusung.GlobalMessage
Assembly: cs.temp.dll.dll
Syntax
public abstract class MessageType : MessageTypeBase
Methods
AddReceiver(UnityAction)
Adds the receiver to this message.
Declaration
public void AddReceiver(UnityAction receiverAction)
Parameters
Type | Name | Description |
---|---|---|
UnityAction | receiverAction | is invoked when the message is sent |
AddReceiver<TMessageType>(UnityAction)
receiverAction
starts receiving messages of type TMessageType
Declaration
public static void AddReceiver<TMessageType>(UnityAction receiverAction)
where TMessageType : MessageType
Parameters
Type | Name | Description |
---|---|---|
UnityAction | receiverAction |
Type Parameters
Name | Description |
---|---|
TMessageType | 0 parameter message type |
RemoveReceiver(UnityAction)
Removes the receiver from this message.
Declaration
public void RemoveReceiver(UnityAction receiverAction)
Parameters
Type | Name | Description |
---|---|---|
UnityAction | receiverAction | is not invoked anymore when the message is sent |
RemoveReceiver<TMessageType>(UnityAction)
Removes the receiver for a 0 parameter message type.
Declaration
public static void RemoveReceiver<TMessageType>(UnityAction receiverAction)
where TMessageType : MessageType
Parameters
Type | Name | Description |
---|---|---|
UnityAction | receiverAction | the receiver action that should be removed |
Type Parameters
Name | Description |
---|---|
TMessageType | the message type for which to remove the receiver |
Send(Object)
Sends this message to it's receivers.
Declaration
public void Send(object sender)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | is displayed as the sender in the unity editor. Can be null if you don't need that info. |
Send<TMessageType>(Object)
Sends a message of type TMessageType
to all it's receivers.
Declaration
public static void Send<TMessageType>(object sender)
where TMessageType : MessageType
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | is displayed as the sender in the unity editor. Can be null if you don't need that info. |
Type Parameters
Name | Description |
---|---|
TMessageType | any 0 parameter message type |