The Public Scene API, a more limited subset of ScenePrivate.
public class ScenePublic : Sansar.Script.InstanceInterfaceMembers at a glance
| Kind | Members |
|---|---|
| Properties | AgentCount · Chat · SceneInfo · User |
| Methods | FindAgent · FindObject · FindReflective · GetAgent · GetAgents · GetPortalCreatorName · GetPortalDescription · GetPortalUri · ToString |
Properties
AgentCount
public uint AgentCount { get; }The number of agents in the Scene.
Value: uint — Unsigned integer count of the number of agents in the Scene.
Remarks
This number changes when agents join and part.
Chat
SceneInfo
public SceneInfo SceneInfo { get; }Gets the SceneInfo for this Scene
Value: SceneInfo — The full SceneInfo Api
User
Methods
FindAgent
public AgentPublic FindAgent(Sansar.Script.ObjectId objectId)Looks up an AgentInfo associated with the given object id.
| Parameter | Type | Description |
|---|---|---|
objectId | Sansar.Script.ObjectId | The object to find. |
Returns: AgentPublic — The AgentInfo, or null if an agent cannot be found with that id.
Remarks
Agents may leave at any time. Attempting to use an Agent or AgentInfo interface for an agent no longer in the scene will throw a NullReferenceException.
public AgentPublic FindAgent(Sansar.Script.SessionId sessionId)Looks up an AgentInfo associated with the given session id, if they are in the scene.
| Parameter | Type | Description |
|---|---|---|
sessionId | Sansar.Script.SessionId | The sessionId of the agent to find. |
Returns: AgentPublic — The AgentInfo, or null if an agent cannot be found with that id.
Remarks
Agents may leave at any time. Attempting to use an Agent or AgentInfo interface for an agent no longer in the scene will throw a NullReferenceException.
public AgentPublic FindAgent(Guid personaId)Looks up an AgentInfo associated with the given persona id, if they are in the scene.
| Parameter | Type | Description |
|---|---|---|
personaId | Guid | The personaId of the agent to find. |
Returns: AgentPublic — The agent, or null if an agent cannot be found with that id in the scene.
Remarks
Agents may leave at any time. Attempting to use an Agent or AgentInfo interface for an agent no longer in the scene will throw a NullReferenceException.
FindObject
public ObjectPublic FindObject(Sansar.Script.ObjectId objectId)Looks up a Object associated with the given object id.
| Parameter | Type | Description |
|---|---|---|
objectId | Sansar.Script.ObjectId | The object to find. |
Returns: ObjectPublic — The ObjectPublic, or null if a Object cannot be found with that id.
FindReflective
[Sansar.Script.NonReflective]
public IEnumerable<TInterface> FindReflective<TInterface>(
string name
) where TInterface : classLooks up Reflective objects in the scene that match the interface type by class name.
| Parameter | Type | Description |
|---|---|---|
name | string | The type name of the object’s class to find. |
Type parameters: TInterface: The interface type to find.
Returns: IEnumerable<TInterface> — An IEnumerable which contains all objects of the given type name that match the given interface.
Remarks
The name given corresponds to the Type.FullName of the object. Multiple scripts may define unrelated types of the same name, but only registered objects that match the interface of TInterface will be returned.
GetAgent
public AgentPublic GetAgent(uint index)Get an AgentPublic for a specific agent in the Scene.
| Parameter | Type | Description |
|---|---|---|
index | uint | The index of the agent to get. |
Returns: AgentPublic — Returns null if the index is larger than the number of agents in the Scene.
Remarks
Agents may appear at different indices as they join and part.
GetAgents
public IEnumerable<AgentPublic> GetAgents()Returns the current list of Agents in the Scene.
Returns: IEnumerable<AgentPublic> — The current list of agents in the Scene
GetPortalCreatorName
public string GetPortalCreatorName(Sansar.Script.ObjectId objectId)The name of the user who created the specified portal.
| Parameter | Type | Description |
|---|---|---|
objectId | Sansar.Script.ObjectId |
Returns: string — String
Remarks
User who created the portal.
GetPortalDescription
public string GetPortalDescription(Sansar.Script.ObjectId objectId)Description for the specified portal.
| Parameter | Type | Description |
|---|---|---|
objectId | Sansar.Script.ObjectId |
Returns: string — String
Remarks
The description of the portal.
GetPortalUri
public string GetPortalUri(Sansar.Script.ObjectId objectId)URI destination for the specified portal.
| Parameter | Type | Description |
|---|---|---|
objectId | Sansar.Script.ObjectId |
Returns: string — String
Remarks
The URI of the destination of the portal.
ToString
public override string ToString()A string representation of this object.
Returns: string — A string representation of this object.
Remarks
The format of this string may change between releases.
Used in examples
Generated from the Sansar 47.10.0 client ScriptApi snapshot.