AgentScript Class
Extend AgentScript to create a script to be attached directly to an agent. For future use: Sansar does not currently support adding scripts to agents.
Syntax
[Sansar.Script.Interface]
public abstract class AgentScript : Sansar.Script.ScriptBase
public abstract class AgentScript : Sansar.Script.ScriptBase
Remarks
Override Sansar.Script.ScriptBase.Init() for script initialization, primarily event subscriptions.
Use AgentScript.ObjectPrivate to access the ObjectPrivate the object that represents the Agent.
Use AgentScript.ScenePublic to access the a limited API for the Scene the agent is in.
Use AgentScript.AgentPrivate to access the Agent the object is attached to.
Requirements
Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0
Members
See Also: Inherited members from Sansar.Script.ScriptBase.
Protected Constructors
|
AgentScript ()
|
This constructor is called before any properties have been set. Override Sansar.Script.ScriptBase.Init() to initialize the script after properties have been set. |
Public Properties
|
AgentPrivate | AgentPrivate . The Agent API for the agent this script is attached to. |
|
Log | Sansar.Script.Log . Gets the script console. (Inherited from Sansar.Script.ScriptBase.) |
|
Memory | Sansar.Script.Memory . Memory information for the pool this script is in. (Inherited from Sansar.Script.ScriptBase.) |
|
ObjectPrivate | ObjectPrivate . The ObjectPrivate this script is attached to if it is attached to an object. |
|
ScenePublic | ScenePublic . Basic scene information for the current scene. |
|
Script | Sansar.Script.ScriptHandle . Script handle to this script. (Inherited from Sansar.Script.ScriptBase.) |
Protected Properties
[read-only]
|
AllowedContexts | Sansar.Script.Reflective.Context . Internal Use Only. Overridden by subclasses to return only those contexts requested which are allowed for that type of script. (Inherited from Sansar.Script.Reflective.) |
[read-only]
|
CurrentCoroutine | Sansar.Script.ICoroutine . Gets the ICoroutine interface for the current coroutine. (Inherited from Sansar.Script.ScriptBase.) |
[read-only]
|
MaxCoroutines | int . The maximum number of coroutines that a single script can run. (Inherited from Sansar.Script.ScriptBase.) |
[read-only]
|
PendingEventCount | int . The number of events currently waiting to be processed. (Inherited from Sansar.Script.ScriptBase.) |
[read-only]
|
ReflectiveContexts | Sansar.Script.Reflective.Context . Override ReflectiveContexts to limit which contexts this Reflective interface is available in when registered with. (Inherited from Sansar.Script.Reflective.) |
[read-only]
|
ReflectiveName | string . Override ReflectiveName to change which name this class will be registered as in the Reflective system. (Inherited from Sansar.Script.Reflective.) |
Public Methods
|
AsInterface<TInterface> () : TInterface
Returns a TInterface object if one can be created, null otherwise (Inherited from Sansar.Script.Reflective.) |
|
|
FullInterface (string) : string
Generates a string which shows all the members which can be reflected. (Inherited from Sansar.Script.Reflective.) |
|
abstract
|
Init ()
Init() is called after all interfaces have been initialized. (Inherited from Sansar.Script.ScriptBase.) |
|
|
Register ()
Register this object to be found with ScenePrivate.FindReflective(string) (Inherited from Sansar.Script.Reflective.) |
|
|
Unregister ()
Unregister this object so it will not be found with ScenePrivate.FindReflective(string) (Inherited from Sansar.Script.Reflective.) |
|
|
Yield ()
Yield to let other coroutines or events run. (Inherited from Sansar.Script.ScriptBase.) |
Protected Methods
Member Details
AgentScript Constructor
This constructor is called before any properties have been set. Override Sansar.Script.ScriptBase.Init() to initialize the script after properties have been set.Syntax
[Sansar.Script.Interface]
protected AgentScript ()Remarks
Requirements
Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0
AgentPrivate Property
The Agent API for the agent this script is attached to.Syntax
[Sansar.Script.NonReflective]
[get: Sansar.Script.Interface]
public AgentPrivate AgentPrivate { protected get; set; }Value
The Agent this script is attached to if the script is on an avatar, null otherwise.Remarks
The Agent will be set before Sansar.Script.ScriptBase.Init is called.Requirements
Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0
ObjectPrivate Property
The ObjectPrivate this script is attached to if it is attached to an object.Syntax
[Sansar.Script.NonReflective]
[get: Sansar.Script.Interface]
public ObjectPrivate ObjectPrivate { protected get; set; }Value
The scene object this script is attached to if it is attached to an object, null otherwise.Remarks
For AgentScripts this is the Agent's ObjectPrivate of their avatar.Requirements
Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0
ScenePublic Property
Basic scene information for the current scene.Syntax
[Sansar.Script.NonReflective]
[get: Sansar.Script.Interface]
public ScenePublic ScenePublic { protected get; set; }Value
The Scene this object is in.Remarks
This value will be set before Init is called.Requirements
Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0
0 Comments