Sinespace Client  2023.2.17543
Client-side scripting for Sinespace
SineSpace.Scripting.Client.SShared Class Reference
Inheritance diagram for SineSpace.Scripting.Client.SShared:
ScriptClass< T > ScriptClassWrapper< T >

Public Member Functions

override void Initialise (SScript runtime, object wrapper)
 
void SetGlobal (string ns, string key, DynValue value)
 
void SetSuperGlobal (string ns, string key, DynValue value)
 
DynValue GetGlobal (string ns, string key)
 Retrieves a previously set global variable, or returns nil. More...
 
DynValue GetSuperGlobal (string ns, string key)
 Retrieves a previously set superglobal variable, or returns nil. More...
 
void RegisterFunction (string ns, string func, Closure reference)
 
void RegisterBroadcastFunction (string ns, string func, Closure reference)
 
void UnregisterBroadcastFunction (string ns, string func, Closure reference)
 
void UnregisterBroadcastFunction (string ns, string func)
 
void CallFunction (string ns, string func, IEnumerable< DynValue > args)
 
int CallBroadcastFunction (string ns, string func, IEnumerable< DynValue > args)
 Calls every registered broadcast function with specified arguments, and returns the number of calls queued. More...
 
- Public Member Functions inherited from ScriptClass< T >
void ReportError (string error, bool fatal, UnityEngine.Object target=null)
 
- Public Member Functions inherited from ScriptClassWrapper< T >
override void Initialise (SScript runtime, object wrapper)
 

Additional Inherited Members

- Protected Member Functions inherited from ScriptClass< T >
void Initialise (SScript runtime)
 
- Properties inherited from ScriptClass< T >
override bool Alive [get]
 Return if the component is alive. More...
 
virtual bool Alive [get]
 
DynValue CachedData [get, set]
 
- Properties inherited from ScriptClassWrapper< T >
_wrap [get]
 

Member Function Documentation

◆ CallBroadcastFunction()

int SineSpace.Scripting.Client.SShared.CallBroadcastFunction ( string  ns,
string  func,
IEnumerable< DynValue >  args 
)

Calls every registered broadcast function with specified arguments, and returns the number of calls queued.

Functions will be called at the start of their next execution context, which may be in the next frame.

Parameters
ns
func
args
Returns

◆ CallFunction()

void SineSpace.Scripting.Client.SShared.CallFunction ( string  ns,
string  func,
IEnumerable< DynValue >  args 
)

◆ GetGlobal()

DynValue SineSpace.Scripting.Client.SShared.GetGlobal ( string  ns,
string  key 
)

Retrieves a previously set global variable, or returns nil.

These variables are shared between scripts, hence a namespace is required

Parameters
nsA namespace, suggest using reverse-DNS ordering, e.g. com.sinewaveentertainment.someScript
keyA individual key name for a variable
Returns

◆ GetSuperGlobal()

DynValue SineSpace.Scripting.Client.SShared.GetSuperGlobal ( string  ns,
string  key 
)

Retrieves a previously set superglobal variable, or returns nil.

Unlike globals, superglobals are not reset by a teleport to another scene.

These variables are shared between scripts, hence a namespace is required

Parameters
nsA namespace, suggest using reverse-DNS ordering, e.g. com.sinewaveentertainment.someScript
keyA individual key name for a variable
Returns

◆ Initialise()

override void SineSpace.Scripting.Client.SShared.Initialise ( SScript  runtime,
object  wrapper 
)
virtual

Implements ScriptClass< T >.

◆ RegisterBroadcastFunction()

void SineSpace.Scripting.Client.SShared.RegisterBroadcastFunction ( string  ns,
string  func,
Closure  reference 
)

◆ RegisterFunction()

void SineSpace.Scripting.Client.SShared.RegisterFunction ( string  ns,
string  func,
Closure  reference 
)

◆ SetGlobal()

void SineSpace.Scripting.Client.SShared.SetGlobal ( string  ns,
string  key,
DynValue  value 
)

◆ SetSuperGlobal()

void SineSpace.Scripting.Client.SShared.SetSuperGlobal ( string  ns,
string  key,
DynValue  value 
)

◆ UnregisterBroadcastFunction() [1/2]

void SineSpace.Scripting.Client.SShared.UnregisterBroadcastFunction ( string  ns,
string  func 
)

◆ UnregisterBroadcastFunction() [2/2]

void SineSpace.Scripting.Client.SShared.UnregisterBroadcastFunction ( string  ns,
string  func,
Closure  reference 
)