Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
bool IsLocked get
Is the Camera locked?
SGameObject MainCamera get
Note, this property is generally read-only. It's position is driven by internal code.
SGameObject ActiveVirtualCamera get
The currently active Cinemachine Virtual Camera game object.
void LockCamera ()
Calling this function stops the Camera from being controlled by the viewer, and allows us to control it until ReleaseCamera() is called.
void ReleaseCamera ()
Calling this function reverses the LockCamera() call and returns control of the Camera to the viewer.
void SetCameraPositionOrientation (SVector position, SQuaternion orientation)
Sets the Camera's position and rotation. This function requires the camera to be locked.
SRay ScreenCoordinatesToRay (SVector screenCoordinates)
Returns a ray going from camera through a screen point.
SVector ScreenCoordinatesToWorld (SVector screenCoordinates)
Transforms a point from screen space into world space.
SVector WorldCoordinatesToScreen (SVector coordinates)
Function Description
void ShakeCamera (float magnitude, float time) void ShakeCamera (float amplitude, float frequency, float time)
Function Description
void InvokeEvent (string name)
Invokes a UnityEvent attached to the Scripting Runtime component this script is executing in.
void Stop ()
Pauses the current script until it is manually restarted, at the end of the current function/method; consider using return as well.
void InvokeDelayed (Closure c, float delay)
Invoke the closure after the delayed time.
void StartCoroutine (DynValue value, DynValue parameter=default(DynValue), string name=null) void StartCoroutine (string value, DynValue parameter=default(DynValue), string name=null)
Executes the specified function as a coroutine.
bool ReferenceExists (string name)
Return true when the reference object exists and is not empty.
bool ReferenceExistsAndNotEmpty (string name)
Return true when the reference object exists and is not empty.
Pulls a reference from the scripting runtime component's "References" section by it's name.
void Evaluate (string script)
Executes given Lua code/script. (white-label only)
A reference to the GameObject that is executing this script. (The GameObject that this Scripting Runtime component is attached to).
string Language get
Returns the English name for the users language, e.g. 'English', 'French', 'Chinese'
void GetEnabledUserRegions (Closure onComplete)
void GetOutfits (Closure onComplete)
bool IsWhiteLabel get
Returns true if this Grid is a white-label Grid.
bool PlayerIsAdmin get
Returns true if this player's Grid role is Admin.(white-label grid only)
bool PlayerIsModerator get
Returns true if this player's Grid role is Moderator. (white-label grid only)
bool PlayerIsDeveloper get
Returns true if this player's Grid role is Developer.(white-label grid only)
bool PlayerIsTrusted get
Returns true if this player's Grid role is Trusted.(white-label grid only)
The viewer's Theme Color 1.
The viewer's theme consist of 4 Theme Colors and 2 Text Colors.
The viewer's Theme Color 2.
The viewer's theme consist of 4 Theme Colors and 2 Text Colors.
The viewer's Theme Color 3.
The viewer's theme consist of 4 Theme Colors and 2 Text Colors.
The viewer's Theme Color 4.
The viewer's theme consist of 4 Theme Colors and 2 Text Colors.
The viewer's Text Color 1.
The viewer's theme consist of 4 Theme Colors and 2 Text Colors.
The viewer's Text Color 2.
The viewer's theme consist of 4 Theme Colors and 2 Text Colors.
string Name get
Returns the Grid's Name. (white-label grid only)
string SiteURL get
Returns the Grid's Site URL. (white-label grid only)
int DefaultRegion get
Returns the Region ID of the Default Region. The Default Region is set in the grid's Dashboard. (white-label grid only)
int[] Avatars get
Returns the IDs of all Avatars in the grid. (white-label grid only)
int OrientationRegion get
Returns the Region ID of the "Orientation Region".
Function Name |
---|
Property |
---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Function Name |
---|
Property Name |
---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
GetReference (string name)
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
ExecutingObject get
Function Name |
---|
Property Name |
---|
Calling this function will asynchronously get and return information about this player's regions as (This is the same information in the "Region List" window).
Parameter | Type | Description |
---|
void GetRegionTexture (region, Closure onComplete) void GetRegionTexture (string json, Closure onComplete)
Returns the Region Texture (the image seen while loading the region) as a resource. This function requires an object to identify which region. (white-label grids only)
Parameter | Type | Description |
---|
Calling this function will asynchronously get and return information about this player's outfits as a List of .
Parameter | Type | Description |
---|
ThemeColor1 get
ThemeColor2 get
ThemeColor3 get
ThemeColor4 get
TextColor1 get
TextColor2 get
void LockCamera (SGameObject owner)
void ReleaseCamera ()
void SetCameraPositionOrientation (SVector position, SQuaternion orientation)
SRay ScreenCoordinatesToRay (SVector screenCoordinates)
SVector ScreenCoordinatesToWorld (SVector screenCoordinates)
SVector WorldCoordinatesToScreen (SVector coordinates)
void ShakeCamera (float magnitude, float time) void ShakeCamera (float amplitude, float frequency, float time)
bool IsLocked get
SGameObject MainCamera get
SGameObject ActiveVirtualCamera get
position
The World Postion of the camera GameObject.
orientation
The World Rotation of the camera GameObject.
name | string | The name of the reference as set within the Scripting Runtime component (references section). |
onComplete | Closure (Callback) |
onComplete | Closure (Callback) |
void UpdateInfo (Closure onComplete)
Call the onComplete function upon the server saving a value.
string RetrieveValue (string key)
Returns the saved value with the key.
void SetValue (string key, string value)
Save a value to the storage record that is accessed with key.
void UpdateRegionInfo (Action onComplete) void UpdateRegionInfo (Closure onComplete)
Updates your local cache with the most up-to-date values from the server. This function should be called before using the RetrieveRegionValue function.
string RetrieveRegionValue (string key)
Retrieves the saved value from "key" from your local cache. The UpdateRegionInfo function should be called first to update your local cache with the most up-to-date values from the server.
void SetRegionValue (string key, string value)
Save the "value" to "key" on both your local cache and on the server.
SPhysicsHit[] RayCast (SVector origin, SVector normal, float distance, SLayerMask layerMask=null)
Raycasts from origin along normal, distance meters - and returns a list of collisions in distance order (closest first)
SPhysicsHit RayCastSingle (SVector origin, SVector normal, float distance, SLayerMask layerMask=null)
Raycasts from origin along normal, distance meters - and returns the first collision.
SPhysicsHit[] SphereCast (SVector origin, float radius, float distance, SVector direction, SLayerMask layerMask=null) SPhysicsHit[] SphereCast (SVector origin, float radius, float distance, SLayerMask layerMask=null)
Sweeps from origin in a spherical ray 'radius' wide, and returns the list of collided objects
SPhysicsHit[] CapsuleCast (SVector origin, SVector end, float radius, float distance, SVector up, SLayerMask layerMask=null) SPhysicsHit[] CapsuleCast (SVector origin, SVector end, float radius, float distance, SLayerMask layerMask=null)
Sweeps a capsule from origin to end, radius wide and returns a list of collisions.
SPhysicsHit[] BoxCast (SVector origin, SVector extents, SVector direction, SQuaternion orientation, float distance, SLayerMask layerMask=null)
Sweeps a box defined by origin+halfExtents along direction, distance meters with a orientation matching orientation - and returns a list of collisions in distance order.
SVector Gravity get
set
The gravity applied to all rigid bodies in the Scene.
Gravity can be turned off for an individual Rigidbody using its UseGravity property.
SCommandBuffer CreateCommandBuffer ()
Return a new CommandBuffer.
void AddCommandBufferToCamera (SCommandBuffer commandbuffer, int cameraEvent=19)
Add the CommandBuffer to the Main Camera.
void RemoveCommandBufferFromCamera (SCommandBuffer commandbuffer, int cameraEvent=19)
Remove the CommandBuffer from the Main Camera.
void SetPostProfile (SResource customProfile)
Set a custom Space Post-Processing Profile.
void ClearPostProfile ()
Clear current Post-Processing profile and restore default one.
void SetCrepsecularRays (bool on, float thresR, float thresG, float thresB, float colorR, float colorG, float colorB, float falloff, float blurSize, int blurIterations, float intensity)
Function Description
void SetAmbientOcclusion (bool on, float intensity, bool aoOnly)
Function Description
void SetMotionBlur (bool on, float shutterAngle)
Function Description
void SetBloom (bool on, float threshold, float intensity)
Function Description
void SetAnamorphicFlares (bool on, float r, float g, float b, float intensity, float threshold, float spread, bool vertical)
Function Description
void SetVignette (bool on, float r, float g, float b, float intensity)
Function Description
void SetLensDirt (bool on, float threshold, SResource texture, float intensity)
Function Description
void SetChromaticAberrationPost (bool on, float strength, float cornerBlur)
Function Description
void SetFocus (SGameObject target)
Function Description
void SupressFocus ()
Function Description
void RestoreFocus ()
Function Description
void SetLookUpTable (SResource lut)
Function Description
SGameObject Find (string name)
Finds a single Game Object matching 'Name' and returns it. Can use '/' characters to designate a path (e.g. 'Parent/Child' returns Child with 'Parent')
SGameObject FindID (string id)
Finds a single Game Object using ID and returns it
void MarkObjectTemporary (SGameObject obj)
Marks the Game Object as temporary. Temporary objects will be cleaned up automatically if the script is destroyed or reset. Can be used to handle cleanup from procedural objects created by a script.
SAvatar GetAvatar (long id) SAvatar GetAvatar (string name)
Get reference to an avatar
SGameObject CreateGameObject (string name) SGameObject CreateGameObject (SResource resource)
Creates a game object from the specified resource
void SwitchToInstance (uint id)
Switch to a shard region.
void OnPlayerJoin (Closure e)
Event which fires whenever a player joins the region
void OnPlayerLeave (Closure e)
Event which fires whenever a player leaves the region
void OnEditModeStart (Closure e)
An event which is fired when player enters Room Edit mode
void OnEditModeEnd (Closure e)
An event which is fired when player exits Room Edit mode
void OnEditModeAdd (Closure e)
An event which is fired when object is added during Edit Mode
void OnEditModeRemove (Closure e)
An event which is fired when object is deleted during Edit Mode
SAvatar PlayerAvatar get
Returns the current player avatar. If this script is calling this upon initialisation, the Player may not exist yet, and you will want to wait a few frames until the avatar is present before continuing.
SAvatar[] Avatars get
Returns a list of Avatars in the scene
List< SAvatar > AllAvatars get
Returns a list of all avatars in the scene. The player avatar that is calling this will be added to the end of the list.
int Population get
Property Description
SGameObject[] Objects get
Returns a list of Objects in the scene. IMPORTANT: This function is slow, you should cache the result and avoid calling this every frame.
string Name get
Returns the name of the current region
string Url get
Returns the URL of the current region
long RegionID get
Returns the region ID of current region.
long InstanceID get
Return the instance ID of current region.
long Owner get
Returns the avatar ID of the regions owner
bool PlayerIsOwner get
Returns whether the current player is the owner of the region
bool PlayerIsAdmin get
Does this Player have the Admin role?
bool PlayerIsModerator get
Does this Player have the Moderator role?
bool PlayerIsDeveloper get
Does this Player have the Developer role?
bool PlayerIsTrusted get
Does this Player have the Trusted role?
bool IsInEditMode get
Returns true if current player is in edit mode.
SGameObject[] Floors get
Return an array of all floors in the region.
SLandmark[] Landmarks get
Return all Landmarks in the region
string TypeName (DynValue dv)
Return the type name of the value.
bool TrackingAllowed (string key)
Function Description
void TrackingRequest (string key, string privacynotice, Closure callback, bool force=false)
Function Description
Returns a reference to a SResource using it's Resource name.
Function Description
void Log (DynValue text, bool logToFile=false) void Log (string text, bool logToFile=false)
Log a message to console.
Allows access to the users inventory
Stores information between user sessions, and for other users
Allows access to the current scene graph (objects and avatars in the scene, and other information)
Property Description
Access information about the current scripting runtime host
Call physics-related commands, and variables, such as raycasting
Math related functions (Sin, Cos, Tan, etc)
Miscellaneous additional string functions (e.g. MD5Sum)
Input device related functions (mouse position, keyboard state)
Take and control the users camera
Call remote web services to designated hosts (will not work with arbitrary domains, see page for details)
Send data to other clients through the region server
Property Description
SAudioAnalyser AudioAnalyser get
Property Description
STween Tween get
Property Description
Property Description
Property Description
Property Description
Property Description
Property Description
Property Description
SActivity Activity get
Property Description
Property Description
Property Description
Property Description
Property Description
SMusicDirectory MusicDirectory get
Property Description
SJourney Journey get
Property Description
SGameTester GameTester get
Property Description
string RuntimeType get
Return current RuntimeType name.
string Platform get
Return current platform name.
string SessionID get
Return current SessionID.
bool InEditor get
Return true if in unity editor.
int Version get
Returns the version of the viewer this script is running in
Property Description
float Time get
Returns time at the beginning of this frame.
string ServerTime get
Returns current server time.
string LocalTime get
Returns current local time.
float LoginTime get
Returns how long player has been logged in (in seconds).
int ServerTimeUnix get
Returns the server time unix timestamp.
int LocalTimeUnix get
Returns the local time unix timestamp.
float DeltaTime get
The completion time in seconds since the last frame.
bool PreviewServer get
Return true if in preview server.
string ComponentName get
The name of this component.
Set a global texture property.
void SetGlobalShaderFloat (string name, float dir)
Set a global float property for all shaders.
Set a global color property for all shaders.
Set a global color property for all shaders.
int DefaultReflectionResolution get
set
Cubemap resolution for default reflection.
The global skybox to use.
float FlareFadeSpeed get
set
The fade speed of all flares in the Scene.
float FlareStrength get
set
The intensity of all flares in the Scene.
float HaloStrength get
set
Size of the light halos.
int ReflectionBounces get
set
The number of times a reflection includes other reflections.
float ReflectionIntensity get
set
How much the skybox / custom cubemap reflection affects the Scene.
The color used for the sun shadows in the Subtractive lightmode.
float AmbientIntensity get
set
How much the light from the Ambient Source affects the Scene.
Flat ambient lighting color.
Ambient lighting coming from below.
Ambient lighting coming from the sides.
Ambient lighting coming from above.
int AmbientMode get
set
Ambient lighting mode. Skybox = 1. Trilight = 2. Flat = 3. Custom = 4.
float FogEndDistance get
set
The ending distance of linear fog.
float FogStartDistance get
set
The starting distance of linear fog.
float FogDensity get
set
The density of the exponential fog.
The color of the fog.
int FogMode get
set
Ambient lighting mode. Linear = 1. Exponential = 2. ExponentialSquared = 3.
bool Fog get
set
Whether Fog is enabled
float AmbientSkyboxAmount get
set
How much the light from the Ambient Source affects the Scene.
int DefaultReflectionMode get
set
Ambient lighting mode. Skybox = 0. Custom = 1.
void (string name)
void ()
void (Closure c, float delay)
void (DynValue value, DynValue parameter=default(DynValue), string name=null) void (string value, DynValue parameter=default(DynValue)
bool (string name)
bool (string name)
SGameObject (string name)
void (string script)
SGameObject get
string get
void (Closure onComplete)
void (SPublicRegion region, Closure onComplete) void (string json, Closure onComplete)
void (Closure onComplete)
bool get
bool get
bool get
bool get
bool get
SColor get
SColor get
SColor get
SColor get
SColor get
SColor get
string get
string get
int get
int[] get
int get
onComplete is a function that will be called on completion with as a parameter. onComplete(SUserRegions)
onComplete is a function that will be called on completion with a List of as a parameter.
Function Name |
---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Function Name |
---|
Property Name |
---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Function Name |
---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Function Name |
---|
Property Name |
---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
GetResource (string name)
Parameter | Type | Description |
---|
void LogEvent (string eventName, float value, position)
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
Inventory get
Persistence get
Scene get
Grid get
Host get
Physics get
Math get
String get
Input get
Camera get
WebServices get
Network get
PostFX get
UI get
Dialogues get
Shared get
Quests get
Economy get
Groups get
RenderSettings get
Profile get
Photos get
Videos get
[] Resources get
Function Name |
---|
Property Name |
---|
void SetGlobalShaderTexture (string name, dir)
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
void SetGlobalShaderColor (string name, dir)
Parameter | Type | Description |
---|
void SetGlobalShaderVector (string name, dir)
Parameter | Type | Description |
---|
Skybox get
set
SubtractiveShadowColor get
set
AmbientLight get
set
AmbientGroundColor get
set
AmbientEquatorColor get
set
AmbientSkyColor get
set
FogColor get
set
void UpdateInfo (Closure onComplete)
string RetrieveValue (string key)
void SetValue (string key, string value)
void UpdateRegionInfo (Action onComplete) void UpdateRegionInfo (Closure onComplete)
string RetrieveRegionValue (string key)
void SetRegionValue (string key, string value)
key
string
Max length 48
value
string
Max length 255
key
string
Max length 48
value
string
Max length 255
SPhysicsHit[] RayCast (SVector origin, SVector normal, float distance, SLayerMask layerMask=null)
SPhysicsHit RayCastSingle (SVector origin, SVector normal, float distance, SLayerMask layerMask=null)
SPhysicsHit[] SphereCast (SVector origin, float radius, float distance, SVector direction, SLayerMask layerMask=null) SPhysicsHit[] SphereCast (SVector origin, float radius, float distance, SLayerMask layerMask=null)
SPhysicsHit[] CapsuleCast (SVector origin, SVector end, float radius, float distance, SVector up, SLayerMask layerMask=null) SPhysicsHit[] CapsuleCast (SVector origin, SVector end, float radius, float distance, SLayerMask layerMask=null)
SPhysicsHit[] BoxCast (SVector origin, SVector extents, SVector direction, SQuaternion orientation, float distance, SLayerMask layerMask=null)
SVector Gravity get
set
origin
SVector
normal
SVector
distance
SVector
layerMask
SLayerMask
Include a layer mask if you do not want to use viewer's defaults.
SCommandBuffer CreateCommandBuffer ()
void AddCommandBufferToCamera (SCommandBuffer commandbuffer, int cameraEvent=19)
void RemoveCommandBufferFromCamera (SCommandBuffer commandbuffer, int cameraEvent=19)
void SetPostProfile (SResource customProfile)
void ClearPostProfile ()
void SetCrepsecularRays (bool on, float thresR, float thresG, float thresB, float colorR, float colorG, float colorB, float falloff, float blurSize, int blurIterations, float intensity)
void SetAmbientOcclusion (bool on, float intensity, bool aoOnly)
void SetMotionBlur (bool on, float shutterAngle)
void SetBloom (bool on, float threshold, float intensity)
void SetAnamorphicFlares (bool on, float r, float g, float b, float intensity, float threshold, float spread, bool vertical)
void SetVignette (bool on, float r, float g, float b, float intensity)
void SetLensDirt (bool on, float threshold, SResource texture, float intensity)
void SetChromaticAberrationPost (bool on, float strength, float cornerBlur)
void SetFocus (SGameObject target)
void SupressFocus ()
void RestoreFocus ()
void SetLookUpTable (SResource lut)
SGameObject Find (string name)
SGameObject FindID (string id)
void MarkObjectTemporary (SGameObject obj)
SGameObject CreateGameObject (string name) SGameObject CreateGameObject (SResource resource)
void SwitchToInstance (uint id)
void OnPlayerJoin (Closure e)
void OnPlayerLeave (Closure e)
void OnEditModeStart (Closure e)
void OnEditModeEnd (Closure e)
void OnEditModeAdd (Closure e)
void OnEditModeRemove (Closure e)
SAvatar PlayerAvatar get
SAvatar[] Avatars get
List< SAvatar > AllAvatars get
int Population get
SGameObject[] Objects get
string Name get
string Url get
long RegionID get
long InstanceID get
long Owner get
bool PlayerIsOwner get
bool PlayerIsAdmin get
bool PlayerIsModerator get
bool PlayerIsDeveloper get
bool PlayerIsTrusted get
bool IsInEditMode get
SGameObject[] Floors get
SLandmark[] Landmarks get
e
Closure (Callback)
e(SAvatar)
e
Closure (Callback)
e(long)
dv | DynValue |
name | string | Name of the Resource as set in the Scripting Runtime Component (Resources section) |
void (string name, SResource dir)
void (string name, float dir)
void (string name, SColor dir)
void (string name, SVector dir)
int get
set
SMaterial get
set
float get
set
float get
set
float get
set
int get
set
float get
set
SColor get
set
float get
set
SColor get
set
SColor get
set
SColor get
set
SColor get
set
SAmbientMode get
set
float get
set
float get
set
float get
set
SColor get
set
SFogMode get
set
bool get
set
float get
set
SDefaultReflectionMode get
set