Class SurferManager
Surfer Singleton that manages states, scene, conditions and actions.
Namespace: Surfer
Assembly: cs.temp.dll.dll
Syntax
public sealed class SurferManager : MonoBehaviour
Fields
kSceneLoadedVisualScripting
Declaration
public const string kSceneLoadedVisualScripting = "_SUSceneLoaded"
Field Value
Type | Description |
---|---|
String |
kSceneUnloadedVisualScripting
Declaration
public const string kSceneUnloadedVisualScripting = "_SUSceneUnloaded"
Field Value
Type | Description |
---|---|
String |
kStateEnterVisualScripting
Declaration
public const string kStateEnterVisualScripting = "_SUStateEnter"
Field Value
Type | Description |
---|---|
String |
kStateExitVisualScripting
Declaration
public const string kStateExitVisualScripting = "_SUStateExit"
Field Value
Type | Description |
---|---|
String |
Properties
I
Declaration
public static SurferManager I { get; }
Property Value
Type | Description |
---|---|
SurferManager |
LastClosedStates
Get all the closed states.This list is cleared after OpenState is called and performed.
Declaration
public HashSet<SUStateEventData> LastClosedStates { get; }
Property Value
Type | Description |
---|---|
HashSet<SUStateEventData> |
LastUnloaded
Get the last unloaded scene
Declaration
public string LastUnloaded { get; }
Property Value
Type | Description |
---|---|
String |
LoadingScenes
Get all the scenes that are currently loading
Declaration
public HashSet<string> LoadingScenes { get; }
Property Value
Type | Description |
---|---|
HashSet<String> |
OpenedScenes
Get all the currently opened scenes
Declaration
public HashSet<string> OpenedScenes { get; }
Property Value
Type | Description |
---|---|
HashSet<String> |
OpenedStates
Get all the currently opened states
Declaration
public HashSet<SUStateEventData> OpenedStates { get; }
Property Value
Type | Description |
---|---|
HashSet<SUStateEventData> |
SO
Surfer Scriptable object that contains states, scenes lists and other data
Declaration
public SurferSO SO { get; }
Property Value
Type | Description |
---|---|
SurferSO |
UnloadingScenes
Get all the scenes that are currently unloading
Declaration
public HashSet<string> UnloadingScenes { get; }
Property Value
Type | Description |
---|---|
HashSet<String> |
Methods
CheckStateStack(String, Int32)
Check if a state has a stack of "opening states"
Declaration
public void CheckStateStack(string state, int playerID)
Parameters
Type | Name | Description |
---|---|---|
String | state | state to check |
Int32 | playerID |
ClosePlayerState(Int32, String, Int32, Object[])
Close a specific state of a specific player with a custom list of data.
Declaration
public void ClosePlayerState(int playerID, string state, int version = 0, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playerID | |
String | state | state name |
Int32 | version | |
Object[] | customData | list of custom variables |
ClosePlayerState(Int32, String, Int32, Single, Object[])
Close a specific state of a specific player with a custom list of data.
Declaration
public void ClosePlayerState(int playerID, string state, int version = 0, float delay = 0F, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playerID | |
String | state | state name |
Int32 | version | |
Single | delay | |
Object[] | customData | list of custom variables |
ClosePlayerState(Int32, String, Object[])
Close a specific state of a spcific playerID with a custom list of data.
Declaration
public void ClosePlayerState(int playerID, string state, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playerID | |
String | state | state name |
Object[] | customData | list of custom variables |
ClosePlayerState(Int32, String, Single, Object[])
Close a specific state of a spcific playerID, with a delay and with a custom list of data.
Declaration
public void ClosePlayerState(int playerID, string state, float delay, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playerID | |
String | state | state name |
Single | delay | |
Object[] | customData | list of custom variables |
CloseState(String, Int32, Object[])
Close a specific state with a custom list of data and a version.
Declaration
public void CloseState(string state, int version = 0, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
String | state | state name |
Int32 | version | |
Object[] | customData | list of custom variables |
CloseState(String, Int32, Single, Object[])
Close a specific state , with a specific delay,version and custom list of data.
Declaration
public void CloseState(string state, int version = 0, float delay = 0F, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
String | state | state name |
Int32 | version | |
Single | delay | delay |
Object[] | customData | list of custom variables |
CloseState(String, Object[])
Close a specific state with a custom list of data.
Declaration
public void CloseState(string state, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
String | state | state name |
Object[] | customData | list of custom variables |
GetStateElementData(String, Int32)
Gets the ElementData of a state
Declaration
public SUElementData GetStateElementData(string stateName, int playerID)
Parameters
Type | Name | Description |
---|---|---|
String | stateName | |
Int32 | playerID |
Returns
Type | Description |
---|---|
SUElementData |
IsClosed(String, Int32)
Check if a state has just been closed
Declaration
public bool IsClosed(string state, int playerID = 0)
Parameters
Type | Name | Description |
---|---|---|
String | state | state name |
Int32 | playerID |
Returns
Type | Description |
---|---|
Boolean | true if closed, false otherwise |
IsOpen(String, Int32)
Check if a state is open or not
Declaration
public bool IsOpen(string state, int playerID = 0)
Parameters
Type | Name | Description |
---|---|---|
String | state | state name |
Int32 | playerID |
Returns
Type | Description |
---|---|
Boolean | true if open, false otherwise |
IsOpen(String, Int32, Int32)
Check if a state is open or not
Declaration
public bool IsOpen(string state, int version = 0, int playerID = 0)
Parameters
Type | Name | Description |
---|---|---|
String | state | state name |
Int32 | version | |
Int32 | playerID |
Returns
Type | Description |
---|---|
Boolean | true if open, false otherwise |
LoadScene(String, Single, Boolean)
Load a specific scene after a specific delay
Declaration
public void LoadScene(string name, float delay = 0F, bool additive = false)
Parameters
Type | Name | Description |
---|---|---|
String | name | scene name |
Single | delay | delay |
Boolean | additive | additive mode or not? |
LoadSceneAsync(String, Single, Boolean, Boolean)
Load a specific scene (async) after a specific delay
Declaration
public void LoadSceneAsync(string name, float delay = 0F, bool additive = false, bool autoActivate = true)
Parameters
Type | Name | Description |
---|---|---|
String | name | scene name |
Single | delay | delay |
Boolean | additive | additive mode or not? |
Boolean | autoActivate | autoActivate when loaded or not? |
OpenPlayerState(Int32, String, Int32, Object[])
Open a specific player state, with a specific version and with a custom list of data.
Declaration
public void OpenPlayerState(int playerID, string state, int version = 0, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playerID | |
String | state | |
Int32 | version | |
Object[] | customData |
OpenPlayerState(Int32, String, Int32, Single, Object[])
Open a specific player state, with a specific version and with a custom list of data.
Declaration
public void OpenPlayerState(int playerID, string state, int version = 0, float delay = 0F, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playerID | |
String | state | |
Int32 | version | |
Single | delay | |
Object[] | customData |
OpenPlayerState(Int32, String, Object[])
Open a specific player state with a custom list of data.
Declaration
public void OpenPlayerState(int playerID, string state, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playerID | |
String | state | state name |
Object[] | customData | list of custom variables |
OpenPrefabState(GameObject, Transform, Int32, Single, Object[])
Open a prefab state , with a specific version, delay, custom list of data and in a specific parent.
Declaration
public void OpenPrefabState(GameObject prefab, Transform parent = null, int version = 0, float delay = 0F, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
GameObject | prefab | state prefab |
Transform | parent | parent |
Int32 | version | state version |
Single | delay | delay |
Object[] | customData | list of custom variables |
OpenState(String, Int32, Object[])
Open a specific state , with a specific version and custom list of data.
Declaration
public void OpenState(string state, int version = 0, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
String | state | state name |
Int32 | version | state version |
Object[] | customData | list of custom variables |
OpenState(String, Int32, Single, Object[])
Open a specific state , with a specific version, delay and custom list of data.
Declaration
public void OpenState(string state, int version = 0, float delay = 0F, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
String | state | state name |
Int32 | version | state version |
Single | delay | delay |
Object[] | customData | list of custom variables |
OpenState(String, Object[])
Open a specific state with a custom list of data.
Declaration
public void OpenState(string state, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
String | state | state name |
Object[] | customData | list of custom variables |
RegisterCustomEvent(ISUCustomEventHandler, String[])
Register to the CustomEvent callback
Declaration
public void RegisterCustomEvent(ISUCustomEventHandler interf, params string[] eventsID)
Parameters
Type | Name | Description |
---|---|---|
ISUCustomEventHandler | interf | object interface used to register |
String[] | eventsID | all the names of the custom events to register to |
RegisterSceneActivated(ISUSceneActivatedHandler, String[])
Register to the SceneActivated callback of specific scenes
Declaration
public void RegisterSceneActivated(ISUSceneActivatedHandler interf, params string[] scenes)
Parameters
Type | Name | Description |
---|---|---|
ISUSceneActivatedHandler | interf | object interface used to register |
String[] | scenes | all the names of the scenes to register to |
RegisterSceneDeactivated(ISUSceneDeactivatedHandler, String[])
Register to the SceneDeactivated callback of specific scenes
Declaration
public void RegisterSceneDeactivated(ISUSceneDeactivatedHandler interf, params string[] scenes)
Parameters
Type | Name | Description |
---|---|---|
ISUSceneDeactivatedHandler | interf | object interface used to register |
String[] | scenes | all the names of the scenes to register to |
RegisterSceneLoaded(ISUSceneLoadedHandler, String[])
Register to the SceneLoaded callback of specific scenes
Declaration
public void RegisterSceneLoaded(ISUSceneLoadedHandler interf, params string[] scenes)
Parameters
Type | Name | Description |
---|---|---|
ISUSceneLoadedHandler | interf | object interface used to register |
String[] | scenes | all the names of the scenes to register to |
RegisterSceneLoading(ISUSceneLoadingHandler, String[])
Register to the SceneLoading callback of specific scenes
Declaration
public void RegisterSceneLoading(ISUSceneLoadingHandler interf, params string[] scenes)
Parameters
Type | Name | Description |
---|---|---|
ISUSceneLoadingHandler | interf | object interface used to register |
String[] | scenes | all the names of the scenes to register to |
RegisterSceneUnloaded(ISUSceneUnloadedHandler, String[])
Register to the SceneUnloaded callback of specific scenes
Declaration
public void RegisterSceneUnloaded(ISUSceneUnloadedHandler interf, params string[] scenes)
Parameters
Type | Name | Description |
---|---|---|
ISUSceneUnloadedHandler | interf | object interface used to register |
String[] | scenes | all the names of the scenes to register to |
RegisterSceneUnloading(ISUSceneUnloadingHandler, String[])
Register to the SceneUnloading callback of specific scenes
Declaration
public void RegisterSceneUnloading(ISUSceneUnloadingHandler interf, params string[] scenes)
Parameters
Type | Name | Description |
---|---|---|
ISUSceneUnloadingHandler | interf | object interface used to register |
String[] | scenes | all the names of the scenes to register to |
RegisterStateEnter(ISUStateEnterHandler, String[])
Register to the StateEnter callback of specific states
Declaration
public void RegisterStateEnter(ISUStateEnterHandler interf, params string[] statesID)
Parameters
Type | Name | Description |
---|---|---|
ISUStateEnterHandler | interf | object interface used to register |
String[] | statesID | all the names of the states to register to |
RegisterStateExit(ISUStateExitHandler, String[])
Register to the StateExit callback of specific states
Declaration
public void RegisterStateExit(ISUStateExitHandler interf, params string[] statesID)
Parameters
Type | Name | Description |
---|---|---|
ISUStateExitHandler | interf | object interface used to register |
String[] | statesID | all the names of the states to register to |
SendCustomEvent(String, Object[])
Declaration
public void SendCustomEvent(string eventName, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
String | eventName | |
Object[] | customData |
SendCustomEvent(String, Single, Object[])
Declaration
public void SendCustomEvent(string eventName, float delay, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
String | eventName | |
Single | delay | |
Object[] | customData |
SetActiveScene(String, Single)
Set a specific scene as active after a specific delay
Declaration
public void SetActiveScene(string name, float delay = 0F)
Parameters
Type | Name | Description |
---|---|---|
String | name | scene name |
Single | delay | delay |
TogglePlayerState(Int32, String, Int32, Object[])
Toggle a specific state with a specific version, a playerID and custom list of data.
Declaration
public void TogglePlayerState(int playerID, string state, int version = 0, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playerID | player ID |
String | state | state name |
Int32 | version | state version |
Object[] | customData | list of custom variables |
TogglePlayerState(Int32, String, Int32, Single, Object[])
Toggle a specific state with a specific version, a playerID and custom list of data.
Declaration
public void TogglePlayerState(int playerID, string state, int version = 0, float delay = 0F, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playerID | player ID |
String | state | state name |
Int32 | version | state version |
Single | delay | |
Object[] | customData | list of custom variables |
ToggleState(String, Int32, Object[])
Toggle a specific state with a specific version and custom list of data.
Declaration
public void ToggleState(string state, int version = 0, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
String | state | state name |
Int32 | version | state version |
Object[] | customData | list of custom variables |
ToggleState(String, Int32, Single, Object[])
Toggle a specific state with a specific version,delay and custom list of data.
Declaration
public void ToggleState(string state, int version = 0, float delay = 0F, params object[] customData)
Parameters
Type | Name | Description |
---|---|---|
String | state | state name |
Int32 | version | state version |
Single | delay | delay |
Object[] | customData | list of custom variables |
UnloadSceneAsync(String, Single)
Unload a specific scene after a specific delay
Declaration
public void UnloadSceneAsync(string name, float delay = 0F)
Parameters
Type | Name | Description |
---|---|---|
String | name | scene name |
Single | delay | delay |
UnregisterCustomEvent(ISUCustomEventHandler, String[])
Unregister to the CustomEvent callback
Declaration
public void UnregisterCustomEvent(ISUCustomEventHandler interf, params string[] eventsID)
Parameters
Type | Name | Description |
---|---|---|
ISUCustomEventHandler | interf | object interface used to unregister |
String[] | eventsID | all the names of the custom events to unregister to |
UnregisterSceneActivated(ISUSceneActivatedHandler, String[])
Unregister to the SceneActivated callback of specific scenes
Declaration
public void UnregisterSceneActivated(ISUSceneActivatedHandler interf, params string[] scenes)
Parameters
Type | Name | Description |
---|---|---|
ISUSceneActivatedHandler | interf | object interface used to unregister |
String[] | scenes | all the names of the scenes to unregister to |
UnregisterSceneDeactivated(ISUSceneDeactivatedHandler, String[])
Unregister to the SceneDeactivated callback of specific scenes
Declaration
public void UnregisterSceneDeactivated(ISUSceneDeactivatedHandler interf, params string[] scenes)
Parameters
Type | Name | Description |
---|---|---|
ISUSceneDeactivatedHandler | interf | object interface used to unregister |
String[] | scenes | all the names of the scenes to unregister to |
UnregisterSceneLoaded(ISUSceneLoadedHandler, String[])
Unregister to the SceneLoaded callback of specific scenes
Declaration
public void UnregisterSceneLoaded(ISUSceneLoadedHandler interf, params string[] scenes)
Parameters
Type | Name | Description |
---|---|---|
ISUSceneLoadedHandler | interf | object interface used to unregister |
String[] | scenes | all the names of the scenes to unregister to |
UnregisterSceneLoading(ISUSceneLoadingHandler, String[])
Unregister to the SceneLoading callback of specific scenes
Declaration
public void UnregisterSceneLoading(ISUSceneLoadingHandler interf, params string[] scenes)
Parameters
Type | Name | Description |
---|---|---|
ISUSceneLoadingHandler | interf | object interface used to unregister |
String[] | scenes | all the names of the scenes to unregister to |
UnregisterSceneUnloaded(ISUSceneUnloadedHandler, String[])
Unregister to the SceneUnloaded callback of specific scenes
Declaration
public void UnregisterSceneUnloaded(ISUSceneUnloadedHandler interf, params string[] scenes)
Parameters
Type | Name | Description |
---|---|---|
ISUSceneUnloadedHandler | interf | object interface used to unregister |
String[] | scenes | all the names of the scenes to unregister to |
UnregisterSceneUnloading(ISUSceneUnloadingHandler, String[])
Unregister to the SceneUnloading callback of specific scenes
Declaration
public void UnregisterSceneUnloading(ISUSceneUnloadingHandler interf, params string[] scenes)
Parameters
Type | Name | Description |
---|---|---|
ISUSceneUnloadingHandler | interf | object interface used to unregister |
String[] | scenes | all the names of the scenes to unregister to |
UnregisterStateEnter(ISUStateEnterHandler, String[])
Unregister to the StateEnter callback of specific states
Declaration
public void UnregisterStateEnter(ISUStateEnterHandler interf, params string[] statesID)
Parameters
Type | Name | Description |
---|---|---|
ISUStateEnterHandler | interf | object interface used to unregister |
String[] | statesID | all the names of the states to unregister to |
UnregisterStateExit(ISUStateExitHandler, String[])
Unegister to the StateExit callback of specific states
Declaration
public void UnregisterStateExit(ISUStateExitHandler interf, params string[] statesID)
Parameters
Type | Name | Description |
---|---|---|
ISUStateExitHandler | interf | object interface used to unregister |
String[] | statesID | all the names of the states to unregister to |