|
|
(10 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | The 'Space' global accessible in every script (for C# scripts, this inherits from the [[Scripting/SpaceScript|SpaceScript]] base class)
| + | This page has moved to: https://docs.sine.space/v/scripting/client-scripting/scene/sscript |
− | | + | |
− | ==Attributes==
| + | |
− | | + | |
− | {{ScriptFunction|SInventory|Inventory|{ get; }|Allows access to the users inventory|5=<pre>Space.Inventory.Authorize()</pre>}}
| + | |
− | | + | |
− | {{ScriptFunction|SPersistence|Persistence|{ get; }|Stores information between user sessions, and for other users|5=<pre>Space.Persistence.RetrieveValue("value1")</pre>}}
| + | |
− | | + | |
− | {{ScriptFunction|SScene|Scene|{ get; }|Allows access to the current scene graph (objects and avatars in the scene, and other information)|5=<pre>Space.Scene.PlayerAvatar</pre>}}
| + | |
− | | + | |
− | {{ScriptFunction|SHost|Host|{ get; }|Access information about the current scripting runtime host|5=<pre>Space.Host.StartCoroutine(CoFunc)</pre>}}
| + | |
− | | + | |
− | {{ScriptFunction|SPhysics|Physics|{ get; }|Call physics-related commands, and variables, such as raycasting|5=<pre>Space.Physics.RayCast(trans.WorldPosition,trans.Forward,50)</pre>}}
| + | |
− | | + | |
− | {{ScriptFunction|SMath|Math|{ get; }|Math related functions (Sin, Cos, Tan, etc)|5=<pre>Space.Math.Ceil(4.0)</pre>}}
| + | |
− | | + | |
− | {{ScriptFunction|SString|String|{ get; }|Miscellaneous additional string functions (e.g. MD5Sum)|5=<pre>Space.String.GetBytes("some data")</pre>}}
| + | |
− | | + | |
− | {{ScriptFunction|SInput|Input|{ get; }|Input device related functions (mouse position, keyboard state)|5=<pre>Space.Input.Vibrate(1,1,false)</pre>}}
| + | |
− | | + | |
− | {{ScriptFunction|SCameraManager|CameraManager|{ get; }|Take and control the users camera|5=<pre>obj = Space.Host.ExecutingObject
| + | |
− | Space.Camera.LockCamera (obj)</pre>}}
| + | |
− | | + | |
− | {{ScriptFunction|SWebService|WebServices|{ get; }|Call remote web services to designated hosts (will not work with arbitrary domains, see page for details)|5=<pre>Space.WebServices.GetImage("example.com/mrlee.jpg")</pre>}}
| + | |
− | | + | |
− | {{ScriptFunction|SNetwork|Network|{ get; }|Send data to other clients through the region server|5=<pre>Space.Network.SubscribeToNetwork("helloworld", gotAMessageFunction)</pre>}}
| + | |
− | | + | |
− | {{ScriptFunction|float|Time|{ get; }|The current viewer time - this will usually correlate with the number of seconds the player has been in the current scene, increments each frame, typically used for animation/tweening|5=<pre>currentTime = Space.Time</pre>}}
| + | |
− | | + | |
− | {{ScriptFunction|DateTime|ServerTime|{ get; }|The current server time - usually UTC, as according to the login server.|5=<pre>serverTime = Space.ServerTime</pre>}}
| + | |
− | | + | |
− | {{ScriptFunction|float|DeltaTime|{ get; }|The current time between this frame, and the previous frame, as used in Update, LateUpdate events, if moving a object, you can multiply it by DeltaTime to get a consistent speed|5=<pre>deltaTime = Space.DeltaTime</pre>}}
| + | |
− | | + | |
− | {{ScriptFunction|void|Log|(string text);|Logs the message to the script debug console|5=<pre>Space.Log("Hello World!")</pre>}}
| + | |
− | | + | |
− | =Members=
| + | |
− | {{ScriptFunction|SResource|GetResource|{string name;}|Returns a resource with its name.|Space.Log(Space.GetResource("Texture").Name)<br>
| + | |
− | ''--Print "Texture" when it is exists.''
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|void|Log|{DynValue text;}|Log a message to console.|Space.Log("Log")<br>
| + | |
− | Space.Log("Log",true)
| + | |
− | }}
| + | |
− | | + | |
− | =Properties=
| + | |
− | | + | |
− | {{ScriptFunction|string|RuntimeType|{get; }|Return current RuntimeType name.|Space.Log(Space.RuntimeType)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|string|Platform|{get; }|Return current platform name.|Space.Log(Space.Platform)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|string|TypeName|{get; }|Return the type name of the value.|Space.Log(Space.TypeName("123"))
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|string|SessionID|{get; }|Return current SessionID.|Space.Log(Space.SessionID)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|bool|TrackingAllowed|{string key;}|Always return false on the main grid.|Space.Log(Space.TrackingAllowed("YourKey"))
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|bool|InEditor|[get;]|Return true if in unity editor.|Space.Log(Space.InEditor)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|SResource|Resources|[get;]|Return all resources.|Space.Log(#Space.Resources)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|float|Time|[get;]|Returns time at the beginning of this frame.|Space.Log(Space.Time)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|string|ServerTime|[get;]|Returns current server time.|Space.Log(Space.ServerTime)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|string|LocalTime|[get;]|Returns current local time.|Space.Log(Space.LocalTime)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|int|ServerTimeUnix|[get;]|Returns server unix timestamp.|Space.Log(Space.ServerTimeUnix)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|int|LocalTimeUnix|[get;]|Returns local unix timestamp.|Space.Log(Space.LocalTimeUnix)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|float|DeltaTime|[get;]|The completion time in seconds since the last frame.|Space.Log(Space.DeltaTime)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|bool|PreviewServer|[get;]|Return true if in preview server.|Space.Log(Space.PreviewServer)
| + | |
− | }}
| + | |
− | | + | |
− | {{Scripting Navbox}}
| + | |