SimpleScript

SimpleScript Class

Extend SimpleScript to create a script that can be used on content that is natively in the scene. This is the primary script type in Sansar.

Syntax

[Sansar.Script.Interface][System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)]public abstract class SimpleScript : Sansar.Script.ScriptBase

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. (Inherited from Sansar.Script.ScriptBase.)

Remarks

Requirements

OnAddUser Method

Code in OnAddUser will run whenever a user enters the scene.

Syntax

[Sansar.Script.Interface][System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)]protected virtual voidOnAddUser (AgentPrivate agent)

Requirements

OnChat Method

Code in OnChat will run whenever chat is heard.

Syntax

[Sansar.Script.Interface][System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)]protected virtual voidOnChat (ChatData data)

Requirements

OnCollision Method

Receive events whenever the object this script is on collides with something or someone.

Syntax

[Sansar.Script.Interface][System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)]protected virtual voidOnCollision (CollisionData data)

Requirements

OnRemoveUser Method

Code in OnRemoveUser will run whenever a user leaves the scene.

Syntax

[Sansar.Script.Interface][System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)]protected virtual voidOnRemoveUser (AgentInfo data)

Requirements

OnScriptEvent Method

Receive events from other scripts.

Syntax

[Sansar.Script.Interface][System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)]protected virtual voidOnScriptEvent (Sansar.Script.ScriptId sourceScriptId, object data)