Script.Base
ScriptBase Constructor
Constructor
Syntaxpublic ScriptBase ()
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
CurrentCoroutine Property
Gets the ICoroutine interface for the current coroutine.
Syntaxprotected ICoroutine CurrentCoroutine { get; }
Value
The ICoroutine interface to the currently running coroutine.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
GetAllCoroutines Method
A list of all coroutines for this script.
SyntaxReturns
A list containing all running or waiting coroutines.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
GetCoroutineCount Method
The total number of coroutines running on this script.
Syntaxprotected int GetCoroutineCount ()
Returns
The total number of coroutines running on this script.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
Init Method
Init() is called after all interfaces have been initialized.
Syntax[Sansar.Script.NonReflective] public abstract void Init ()
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
Lock Method
Use to create a critical section with a using statement, ensuring that no other coroutines or scripts (via Reflective) may enter this code section while one coroutine or script is in it.
SyntaxSee Also
Parameters
Token
The object controlling the lock. Recommended to be a private object member.
Returns
A ScopedLock that holds the lock and will release it in IDisposable.Dispose.
Exceptions
Thrown if Token is null.
Remarks
Example
C# Example
|
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
Log Property
Gets the script console.
Syntax[Sansar.Script.NonReflective] public Log Log { protected get; set; }
Value
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
MaxCoroutines Property
The maximum number of coroutines that a single script can run.
Syntaxprotected int MaxCoroutines { get; }
Value
The maximum number of coroutines that a single script can run.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
Memory Property
Memory information for the pool this script is in.
Syntax[Sansar.Script.NonReflective] public Memory Memory { protected get; set; }
Value
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
PendingEventCount Property
The number of events currently waiting to be processed.
Syntaxprotected int PendingEventCount { get; }
Value
The number of events currently waiting to be processed.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
PostScriptEvent Method
Post the event for all scripts.
Syntaxprotected void PostScriptEvent (string message)
Parameters
message
The message id used to direct the event.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
PostScriptEvent Method
Post the event for all scripts.
SyntaxParameters
message
The message id used to direct the event.
data
The object to be post.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
PostScriptEvent Method
Post the event for the target script.
SyntaxParameters
targetScriptId
The id of the script to sent the event to. To broadcast the message to all subscripted scripts use ScriptBase.PostScriptEvent(string, Reflective).
message
The message id used to direct the event.
data
The object to be post.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
PostSimpleScriptEvent Method
Syntax[System.Obsolete("Deprecated. Use PostScriptEvent directly instead.", true)] protected void PostSimpleScriptEvent (string message, object data)
See Also
Parameters
message
The message id used to direct the event.
data
An object to send to scripts subscribed to message.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
PostSimpleScriptEvent Method
Syntax[System.Obsolete("Deprecated. Use PostScriptEvent directly instead.", true)] protected void PostSimpleScriptEvent (ScriptId targetScriptId, string message, object data)
See Also
Parameters
targetScriptId
The id of the script to sent the event to. To broadcast the message to all subscripted scripts use ScriptBase.PostSimpleScriptEvent(string, object).
message
The message id used to direct the event.
data
An object to send to script targetScriptId if subscribed to message.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
ReleaseLock Method
Release a lock if held.
Syntaxprotected void ReleaseLock (object Token)
See Also
Parameters
Token
The object controlling the lock. Recommended to be a private object member.
Exceptions
Thrown if Token is null.
Remarks
Example
C# Example
|
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
Script Property
Script handle to this script.
Syntax[Sansar.Script.NonReflective] public ScriptHandle Script { protected get; set; }
Value
An opaque type used by certain API methods.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
ScriptEventMessageIdCount Property
Obsolete
Syntax[System.Obsolete("No longer used as there is no longer a limited number of message ids. Obsoleted 2018-04.", true)] protected static int ScriptEventMessageIdCount { get; }
Value
Always returns 0
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
StartCoroutine Method
Starts a coroutine on the current script.
SyntaxParameters
coroutine
The coroutine to run.
handler
A callback to know when the coroutine has finished.
Returns
An ICoroutine interface to stop the coroutine or see if it has finished.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
StartCoroutine Generic Method
Starts a coroutine on the current script.
SyntaxType Parameters
T
Type of the first parameter to pass to the coroutine when it is run. This can usually be derived from the Action.
Parameters
coroutine
The coroutine to run.
arg1
First parameter to pass to the coroutine when it is run.
handler
A callback to know when the coroutine has finished. Will report Success==false only if an exception was thrown by the coroutine. Message will be the name of the coroutine.
Returns
An ICoroutine interface to stop the coroutine or see if it has finished.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
StartCoroutine<T,T1> Generic Method
Starts a coroutine on the current script.
SyntaxType Parameters
T
Type of the first parameter to pass to the coroutine when it is run. This can usually be derived from the Action.
T1
Type of the second parameter to pass to the coroutine when it is run. This can usually be derived from the Action.
Parameters
coroutine
The coroutine to run.
arg1
First parameter to pass to the coroutine when it is run.
arg2
Second parameter to pass to the coroutine when it is run.
handler
A callback to know when the coroutine has finished. Will report Success==false only if an exception was thrown by the coroutine. Message will be the name of the coroutine.
Returns
An ICoroutine interface to stop the coroutine or see if it has finished.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
StartCoroutine<T,T1,T2> Generic Method
Starts a coroutine on the current script.
SyntaxType Parameters
T
Type of the first parameter to pass to the coroutine when it is run. This can usually be derived from the Action.
T1
Type of the second parameter to pass to the coroutine when it is run. This can usually be derived from the Action.
T2
Type of the third parameter to pass to the coroutine when it is run. This can usually be derived from the Action.
Parameters
coroutine
The coroutine to run.
arg1
First parameter to pass to the coroutine when it is run.
arg2
Second parameter to pass to the coroutine when it is run.
arg3
Third parameter to pass to the coroutine when it is run.
handler
A callback to know when the coroutine has finished. Will report Success==false only if an exception was thrown by the coroutine. Message will be the name of the coroutine.
Returns
An ICoroutine interface to stop the coroutine or see if it has finished.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
StartCoroutine<T,T1,T2,T3> Generic Method
Starts a coroutine on the current script.
Syntaxprotected ICoroutine StartCoroutine<T, T1, T2, T3> (Action<T, T1, T2, T3> coroutine, T arg1, T1 arg2, T2 arg3, T3 arg4, Action handler)
Type Parameters
T
Type of the first parameter to pass to the coroutine when it is run. This can usually be derived from the Action.
T1
Type of the second parameter to pass to the coroutine when it is run. This can usually be derived from the Action.
T2
Type of the third parameter to pass to the coroutine when it is run. This can usually be derived from the Action.
T3
Type of the fourth parameter to pass to the coroutine when it is run. This can usually be derived from the Action.
Parameters
coroutine
The coroutine to run.
arg1
First parameter to pass to the coroutine when it is run.
arg2
Second parameter to pass to the coroutine when it is run.
arg3
Third parameter to pass to the coroutine when it is run.
arg4
Fourth parameter to pass to the coroutine when it is run.
handler
A callback to know when the coroutine has finished. Will report Success==false only if an exception was thrown by the coroutine. Message will be the name of the coroutine.
Returns
An ICoroutine interface to stop the coroutine or see if it has finished.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
SubscribeToScriptEvent Method
Subscribes to events sent by other scripts
SyntaxParameters
message
The event message to listen for.
callback
Handler to call when the event is generated
persistent
Set to false if a one time event is desired.
Returns
An IEventSubscription that can be used to Unsubscribe from these script events.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
SubscribeToScriptEvent Method
Subscribes to events sent only by a specific script.
SyntaxParameters
sourceScriptId
Ignore events posted by scripts not matching this id.
message
The event message to listen for.
callback
Handler to call when the event is generated.
persistent
Set to false if a one time event is desired.
Returns
An IEventSubscription that can be used to Unsubscribe from these script events.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
Terminate Method
Terminates this script immediately.
Syntaxprotected void Terminate (string message)
Parameters
message
The message to write to the log.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
Wait Method
Delays execution of the current coroutine for the specified time.
SyntaxParameters
duration
The length of time to wait before continuing in seconds.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
Wait Method
Delays execution of the current coroutine for the specified time.
SyntaxParameters
duration
The length of time to wait before continuing.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor Method
Block the current coroutine until otherCoroutine finishes.
SyntaxParameters
otherCoroutine
The coroutine to wait for.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor Method
Use to pause the script until an event happens.
SyntaxParameters
func
The event-generating API to wait for.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor Method
Use to pause the script until an event happens.
SyntaxParameters
func
The event-generating API to wait for.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor Method
Use to pause the script until an event happens.
SyntaxParameters
func
The event-generating API to wait for.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor Method
Use to pause the script until an event happens.
SyntaxParameters
func
The event-generating API to wait for.
run
An Action to run after subscribing the the event, but before waiting for the event to occurr.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor Generic Method
Use to pause the script until an event happens.
SyntaxType Parameters
ARG1
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
arg1
An argument to func.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor Generic Method
Use to pause the script until an event happens.
SyntaxType Parameters
ARG1
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
arg1
An argument to func.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor Generic Method
Use to pause the script until an event happens.
SyntaxType Parameters
ARG1
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
arg1
An argument to func.
run
An Action to run after subscribing the the event, but before waiting for the event to occurr.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor Generic Method
Use to pause the script until an event happens.
SyntaxType Parameters
T1
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
t1
An argument to func.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor<ARG1,ARG2> Generic Method
Use to pause the script until an event happens.
SyntaxType Parameters
ARG1
The type of the argument to func.
ARG2
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
arg1
An argument to func.
arg2
An argument to func.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor<ARG1,ARG2> Generic Method
Use to pause the script until an event happens.
SyntaxType Parameters
ARG1
The type of the argument to func.
ARG2
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
arg1
An argument to func.
arg2
An argument to func.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor<ARG1,ARG2> Generic Method
Use to pause the script until an event happens.
SyntaxType Parameters
ARG1
The type of the argument to func.
ARG2
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
arg1
An argument to func.
arg2
An argument to func.
run
An Action to run after subscribing the the event, but before waiting for the event to occurr.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor<T1,T2> Generic Method
Use to pause the script until an event happens.
SyntaxType Parameters
T1
The type of the argument to func.
T2
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
t1
An argument to func.
t2
An argument to func.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor<ARG1,ARG2,ARG3> Generic Method
Use to pause the script until an event happens.
Syntaxprotected EventData WaitFor<ARG1, ARG2, ARG3> (Func<ARG1, ARG2, ARG3, Action, Action<Sansar.Script.CancelData>,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, ARG3 arg3)
Type Parameters
ARG1
The type of the argument to func.
ARG2
The type of the argument to func.
ARG3
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
arg1
An argument to func.
arg2
An argument to func.
arg3
An argument to func.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor<ARG1,ARG2,ARG3> Generic Method
Use to pause the script until an event happens.
Syntaxprotected EventData WaitFor<ARG1, ARG2, ARG3> (Func<ARG1, ARG2, ARG3, Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, ARG3 arg3)
Type Parameters
ARG1
The type of the argument to func.
ARG2
The type of the argument to func.
ARG3
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
arg1
An argument to func.
arg2
An argument to func.
arg3
An argument to func.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor<ARG1,ARG2,ARG3> Generic Method
Use to pause the script until an event happens.
Syntaxprotected EventData WaitFor<ARG1, ARG2, ARG3> (Func<ARG1, ARG2, ARG3, Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, ARG3 arg3, Action run)
Type Parameters
ARG1
The type of the argument to func.
ARG2
The type of the argument to func.
ARG3
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
arg1
An argument to func.
arg2
An argument to func.
arg3
An argument to func.
run
An Action to run after subscribing the the event, but before waiting for the event to occurr.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor<T1,T2,T3> Generic Method
Use to pause the script until an event happens.
SyntaxType Parameters
T1
The type of the argument to func.
T2
The type of the argument to func.
T3
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
t1
An argument to func.
t2
An argument to func.
t3
An argument to func.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor<ARG1,ARG2,ARG3,ARG4> Generic Method
Use to pause the script until an event happens.
Syntaxprotected EventData WaitFor<ARG1, ARG2, ARG3, ARG4> (Func<ARG1, ARG2, ARG3, ARG4, Action, Action<Sansar.Script.CancelData>,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4)
Type Parameters
ARG1
The type of the argument to func.
ARG2
The type of the argument to func.
ARG3
The type of the argument to func.
ARG4
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
arg1
An argument to func.
arg2
An argument to func.
arg3
An argument to func.
arg4
An argument to func.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor<ARG1,ARG2,ARG3,ARG4> Generic Method
Use to pause the script until an event happens.
Syntaxprotected EventData WaitFor<ARG1, ARG2, ARG3, ARG4> (Func<ARG1, ARG2, ARG3, ARG4, Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4)
Type Parameters
ARG1
The type of the argument to func.
ARG2
The type of the argument to func.
ARG3
The type of the argument to func.
ARG4
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
arg1
An argument to func.
arg2
An argument to func.
arg3
An argument to func.
arg4
An argument to func.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor<ARG1,ARG2,ARG3,ARG4> Generic Method
Use to pause the script until an event happens.
Syntaxprotected EventData WaitFor<ARG1, ARG2, ARG3, ARG4> (Func<ARG1, ARG2, ARG3, ARG4, Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, Action run)
Type Parameters
ARG1
The type of the argument to func.
ARG2
The type of the argument to func.
ARG3
The type of the argument to func.
ARG4
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
arg1
An argument to func.
arg2
An argument to func.
arg3
An argument to func.
arg4
An argument to func.
run
An Action to run after subscribing the the event, but before waiting for the event to occurr.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor<T1,T2,T3,T4> Generic Method
Use to pause the script until an event happens.
Syntaxprotected OperationCompleteEvent WaitFor<T1, T2, T3, T4> (Action<T1, T2, T3, T4, Action> func, T1 t1, T2 t2, T3 t3, T4 t4)
Type Parameters
T1
The type of the argument to func.
T2
The type of the argument to func.
T3
The type of the argument to func.
T4
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
t1
An argument to func.
t2
An argument to func.
t3
An argument to func.
t4
An argument to func.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor<ARG1,ARG2,ARG3,ARG4,ARG5> Generic Method
Use to pause the script until an event happens.
Syntaxprotected EventData WaitFor<ARG1, ARG2, ARG3, ARG4, ARG5> (Func<ARG1, ARG2, ARG3, ARG4, ARG5, Action, Action<Sansar.Script.CancelData>,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5)
Type Parameters
ARG1
The type of the argument to func.
ARG2
The type of the argument to func.
ARG3
The type of the argument to func.
ARG4
The type of the argument to func.
ARG5
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
arg1
An argument to func.
arg2
An argument to func.
arg3
An argument to func.
arg4
An argument to func.
arg5
An argument to func.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor<ARG1,ARG2,ARG3,ARG4,ARG5> Generic Method
Use to pause the script until an event happens.
Syntaxprotected EventData WaitFor<ARG1, ARG2, ARG3, ARG4, ARG5> (Func<ARG1, ARG2, ARG3, ARG4, ARG5, Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5)
Type Parameters
ARG1
The type of the argument to func.
ARG2
The type of the argument to func.
ARG3
The type of the argument to func.
ARG4
The type of the argument to func.
ARG5
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
arg1
An argument to func.
arg2
An argument to func.
arg3
An argument to func.
arg4
An argument to func.
arg5
An argument to func.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitFor<ARG1,ARG2,ARG3,ARG4,ARG5> Generic Method
Use to pause the script until an event happens.
Syntaxprotected EventData WaitFor<ARG1, ARG2, ARG3, ARG4, ARG5> (Func<ARG1, ARG2, ARG3, ARG4, ARG5, Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, Action run)
Type Parameters
ARG1
The type of the argument to func.
ARG2
The type of the argument to func.
ARG3
The type of the argument to func.
ARG4
The type of the argument to func.
ARG5
The type of the argument to func.
Parameters
func
The event-generating API to wait for.
arg1
An argument to func.
arg2
An argument to func.
arg3
An argument to func.
arg4
An argument to func.
arg5
An argument to func.
run
An Action to run after subscribing the the event, but before waiting for the event to occurr.
Returns
An EventData that can be case to type corresponding to the event type of func.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitForLock Method
WaitFor and take a lock on Token
Syntaxprotected void WaitForLock (object Token)
See Also
Parameters
Token
The object controlling the lock. Recommended to be a private object member.
Exceptions
Thrown if Token is null.
Remarks
Example
C# Example
|
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
WaitForSignal Method
Wait the current coroutine until at least 1 signal is sent to it through the ICoroutine interface.
Syntaxprotected int WaitForSignal ()
Returns
The number of signals received while waiting.
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
Yield Method
Yield to let other coroutines or events run.
Syntax[Sansar.Script.NonReflective] public void Yield ()
Remarks
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
Last updated