Class AppEvent
An RuntimeObject which acts as an event handle.
Namespace: ScriptableFramework
Assembly: cs.temp.dll.dll
Syntax
public class AppEvent : AppEventBase
Properties
ListenerCount
Returns the count of all listeners on this event.
Declaration
public int ListenerCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Clear()
Clear this event of all it's listeners
Declaration
public override void Clear()
Overrides
RaiseEvent(String, String, Int32)
Invoke every function callback that is delegated to every event listener that is listenning to this event.
Declaration
public override bool RaiseEvent(string fileName = "", string methodName = "", int callerLineNumber = 0)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | Name of the .cs file the event was raised from (assigned automatically) |
System.String | methodName | Name of the method the event was raised from (assigned automatically) |
System.Int32 | callerLineNumber | Line number the event was raised from (assigned automatically) |
Returns
Type | Description |
---|---|
System.Boolean | Returns whether or not the event was raised successfully. |
Overrides
RaiseFromUI()
Simplified wrapper method that can be referenced by UnityEvents to allow directly calling events from UI callbacks.
Declaration
public virtual void RaiseFromUI()
RegisterListener(AppEventListener)
If not already registered, add an app event listener to this event's list of listeners.
Declaration
public bool RegisterListener(AppEventListener listener)
Parameters
Type | Name | Description |
---|---|---|
AppEventListener | listener | An instance of a listener component in the current scene. |
Returns
Type | Description |
---|---|
System.Boolean | Returns whether or not the listener was registered successfully. |
Reset()
Calls Clear ()
Declaration
public override void Reset()
Overrides
UnregisterListener(AppEventListener)
If already registered, remove an app event listener from this event's list of listeners.
Declaration
public bool UnregisterListener(AppEventListener listener)
Parameters
Type | Name | Description |
---|---|---|
AppEventListener | listener | An instance of a listener component in the current scene. |
Returns
Type | Description |
---|---|
System.Boolean | Returns whether or not the listener was unregistered successfully. |