• Manual
  • Scripting API
Show / Hide Table of Contents
  • ScriptableFramework
    • AnimatorList
    • AnimatorListPopulator
    • AnimatorReference
    • AnimatorReferencePopulator
    • AppEvent
    • AppEvent<T>
    • AppEventBase
    • AppEventListener
    • AppEventListener<T>
    • AppEventListenerBase
    • AppVersion
    • BoolEvent
    • BoolEventListener
    • BoolList
    • BoolResponse
    • BoolValue
    • BoundsEvent
    • BoundsEventListener
    • BoundsResponse
    • ColorEvent
    • ColorEventListener
    • ColorList
    • ColorResponse
    • ColorValue
    • DataString
    • DefaultState
    • Dragable
    • Extensions
    • FloatEvent
    • FloatEventListener
    • FloatList
    • FloatResponse
    • FloatValue
    • FoldoutAttribute
    • GameObjectList
    • GameObjectListPopulator
    • GameObjectReference
    • GameObjectReferencePopulator
    • InputValidation
    • IntEvent
    • IntEventListener
    • IntList
    • IntResponse
    • IntValue
    • IReferenceContainer
    • IValueContainer
    • MeshRendererList
    • MeshRendererListPopulator
    • MeshRendererReference
    • MeshRendererReferencePopulator
    • PathType
    • Platform
    • ReferenceItem<T>
    • ReferenceList<T>
    • ReleaseType
    • RuntimeItem<T>
    • RuntimeList<T>
    • RuntimeObject
    • RuntimeObjectManager
    • SceneAsset
    • SceneAsset.SceneLoadException
    • SearchableEnumAttribute
    • StateChange
    • StateMachine
    • StateMachineBase
    • StateMachineController
    • StateMachineReset
    • StateToggle
    • StringEvent
    • StringEventListener
    • StringList
    • StringResponse
    • StringValue
    • TransformList
    • TransformListPopulator
    • TransformReference
    • TransformReferencePopulator
    • ValueItem<T>
    • ValueList<T>
    • Vector2Event
    • Vector2EventListener
    • Vector2List
    • Vector2Response
    • Vector2Value
    • Vector3Event
    • Vector3EventListener
    • Vector3List
    • Vector3Response
    • Vector3Value
  • ScriptableFramework.CustomEditors
    • AppEventEditor
    • AppEventListenerEditor
    • AppVersionEditor
    • DataStringEditor
    • EditorOverride
    • EditorOverride.Cache
    • EditorOverride.Colors
    • FrameworkExtensions
    • RuntimeObjectEditor
    • RuntimeObjectManagerEditor
    • SceneAssetEditor
    • SearchableEnumDrawer
    • SearchablePopup
  • ScriptableFramework.Tests
    • AppEventGenericTests
    • AppEventGenericTests.ClearData
    • AppEventGenericTests.RaiseEvent
    • AppEventGenericTests.RegisterListener
    • AppEventGenericTests.UnregisterListener
    • AppEventListenerGenericTests
    • AppEventListenerGenericTests.OnEventRaised
    • AppEventListenerGenericTests.RegisterSelf
    • AppEventListenerGenericTests.UnregisterSelf
    • AppEventListenerTests
    • AppEventListenerTests.OnEventRaised
    • AppEventListenerTests.RegisterSelf
    • AppEventListenerTests.UnregisterSelf
    • AppEventTests
    • AppEventTests.ClearData
    • AppEventTests.RaiseEvent
    • AppEventTests.RegisterListener
    • AppEventTests.UnregisterListener
    • DataStringTests
    • ListenerResponder
    • ReferenceItemTests
    • ReferenceItemTests.ClearData
    • ReferenceItemTests.ClearWithForAssetReferencingOnly
    • ReferenceListTests
    • ReferenceListTests.ClearData
    • ReferenceListTests.ClearWithForAssetReferencingOnly
    • StateMachineTests
    • StateMachineTests.ClearData
    • StateMachineTests.ReapplyState
    • StateMachineTests.UpdateStateForAll
    • StateMachineTests.UpdateStateForIndex
    • StateMachineTests.UpdateStateForRange
    • StateMachineTests.UpdateStateForSingle
    • StateToggleTests
    • StateToggleTests.RespondToStateMachineChange
    • StateToggleTests.UpdateStateMachine
    • StringListTests
    • ValueItemTests
    • ValueItemTests.ClearData
    • ValueListTests
    • ValueListTests.ClearData

Class AppEvent<T>

An abstract generic RuntimeObject which acts as an event handle. Inherit from this class to create your own event. Give your class the CreateAssetMenu attribute to serialize an instance of it.

Inheritance
System.Object
RuntimeObject
AppEventBase
AppEvent<T>
BoolEvent
BoundsEvent
ColorEvent
FloatEvent
IntEvent
StringEvent
Vector2Event
Vector3Event
Namespace: ScriptableFramework
Assembly: cs.temp.dll.dll
Syntax
public abstract class AppEvent<T> : AppEventBase
Type Parameters
Name Description
T

The type of the object that will will be passed when raising an event

Fields

valueForManualTrigger

When testing your generic event in the editor, this value will be passed to each listener.

Declaration
public T valueForManualTrigger
Field Value
Type Description
T

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
RuntimeObject.Clear()

RaiseEvent(T, String, String, Int32)

Invoke every function callback that is delegated to every event listener that is listenning to this event. If there are no listeners, a warning will be given.

Declaration
public virtual bool RaiseEvent(T value, string fileName = "", string methodName = "", int callerLineNumber = 0)
Parameters
Type Name Description
T value

The value that will be passed to all current listeners which will in turn pass the value to each delegated function in each listener.

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.

RaiseEvent(String, String, Int32)

Invoke every function callback that is delegated to every event listener that is listenning to this event using valueForManualTrigger or an empty instance of T depending on.

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
AppEventBase.RaiseEvent(String, String, Int32)

RaiseFromUI(T)

Simplified wrapper method that can be referenced by UnityEvents to allow directly calling events from UI callbacks.

Declaration
public virtual void RaiseFromUI(T value)
Parameters
Type Name Description
T value

The dynamic or static value passed from the UI.

RegisterListener(AppEventListener<T>)

If not already registered, add an app event listener to this event's list of listeners.

Declaration
public bool RegisterListener(AppEventListener<T> listener)
Parameters
Type Name Description
AppEventListener<T> 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
RuntimeObject.Reset()

UnregisterListener(AppEventListener<T>)

If already registered, remove an app event listener from this event's list of listeners.

Declaration
public bool UnregisterListener(AppEventListener<T> listener)
Parameters
Type Name Description
AppEventListener<T> 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.

Back to top Generated by DocFX