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

Public Member Functions

override void Initialise (SScript runtime, object wrapper)
 
void UpdateInfo (Action onComplete)
 
void UpdateInfo (Closure onComplete)
 Call the onComplete function upon the server saving a value. More...
 
string RetrieveValue (string key)
 Returns the saved value with the key. More...
 
void SetValue (string key, string value)
 Save the string value to the key. More...
 
void UpdateRegionInfo (Action onComplete)
 
void UpdateRegionInfo (Closure onComplete)
 Call the onComplete function upon the server saving a value. More...
 
string RetrieveRegionValue (string key)
 Returns the saved value. More...
 
void SetRegionValue (string key, string value)
 Save the string value to the key. 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)
 

Static Public Attributes

const float TimeBetweenCalls = 15f
 

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

◆ Initialise()

override void SineSpace.Scripting.Scene.SPersistence.Initialise ( SScript  runtime,
object  wrapper 
)
virtual

Implements ScriptClass< T >.

◆ RetrieveRegionValue()

string SineSpace.Scripting.Scene.SPersistence.RetrieveRegionValue ( string  key)

Returns the saved value.

Parameters
key
Space.Persistence.RetrieveRegionValue("TestRegionValue");

◆ RetrieveValue()

string SineSpace.Scripting.Scene.SPersistence.RetrieveValue ( string  key)

Returns the saved value with the key.

Parameters
key
Space.Persistence.RetrieveValue("TestValue");

◆ SetRegionValue()

void SineSpace.Scripting.Scene.SPersistence.SetRegionValue ( string  key,
string  value 
)

Save the string value to the key.

Parameters
key
value
Space.Persistence.SetRegionValue("TestRegionValue","456")

◆ SetValue()

void SineSpace.Scripting.Scene.SPersistence.SetValue ( string  key,
string  value 
)

Save the string value to the key.

Parameters
key
value
Space.Persistence.SetValue("MyValue", "Hello World");

◆ UpdateInfo() [1/2]

void SineSpace.Scripting.Scene.SPersistence.UpdateInfo ( Action  onComplete)

◆ UpdateInfo() [2/2]

void SineSpace.Scripting.Scene.SPersistence.UpdateInfo ( Closure  onComplete)

Call the onComplete function upon the server saving a value.

Parameters
onCompleteThe closure you want to call after complete this function
Space.Persistence.SetValue("TestValue","123")
Space.Persistence.UpdateInfo(function ()
&ndash;Must call UpdateInfo first to get the lastest value
local value = Space.Persistence.RetrieveValue("TestValue")
Space.Log(value)
&ndash;print "123" to console
end)

◆ UpdateRegionInfo() [1/2]

void SineSpace.Scripting.Scene.SPersistence.UpdateRegionInfo ( Action  onComplete)

◆ UpdateRegionInfo() [2/2]

void SineSpace.Scripting.Scene.SPersistence.UpdateRegionInfo ( Closure  onComplete)

Call the onComplete function upon the server saving a value.

Parameters
onCompleteThe closure you want to call after complete this function
Space.Persistence.SetRegionValue("TestRegionValue","456")
Space.Persistence.UpdateRegionInfo(function ()
&ndash;Must call UpdateInfo first to get the lastest value
local value = Space.Persistence.RetrieveRegionValue("TestRegionValue")
Space.Log(value)
&ndash;print "456" to console
end)

Member Data Documentation

◆ TimeBetweenCalls

const float SineSpace.Scripting.Scene.SPersistence.TimeBetweenCalls = 15f
static
SineSpace.Scripting.Scene.SPersistence.UpdateInfo
void UpdateInfo(Action onComplete)
Definition: SPersistence.cs:27