Scene
Summary
Scene object that contains all actors and lifecycle.
Remarks
Danger
All calls made within this class MUST be performed on the Master Thread.
See
Definition
Namespace: SDT4.Managed.Core
Assembly: SDT4.Managed.Core.dll
class Scene
Inheritance:
Object ➔ Scene
Implements:
IDisposable
Fields
| Name | Type | Description |
|---|---|---|
Properties
| Name | Type | Description |
|---|---|---|
Methods
public T AsScript<T>()
Summary
Gets the
Returns:
- T: A valid T if it is a derived instance of a non-null SceneScript. Returns NULL otherwise.
public Void Reparent(Actor newParent, Actor child)
Parameters:
public Actor CreateEmptyActor(String? name, Boolean isStationary)
Parameters:
Returns:
public Actor CreatePrefabActor(IPrefabAsset prefab, String? name, Boolean isStationary, Object? payload)
Summary
Creates an actor from a prefab asset. This will instantiate a new instance of actors from the prefab chain, and optionally initialise a script if the prefab has one.
Parameters:
-
prefab(IPrefabAsset): Prefab asset to create the actor from -
name(String?): Optional actor name, if null, no name is given. -
isStationary(Boolean): Advanced: if the actor should be treated as a stationary object. This means the actor is NOT allowed to alter positions or state. -
payload(Object?): Optional script payload that is provided in thefunction
Returns:
public Actor GetActorFromId(UInt64 id)
Parameters:
id(UInt64):
Returns:
public Actor GetActorFromGuid(Guid guid)
Parameters:
guid(Guid):
Returns:
public Actor[] GetActorsWithName(String name)
Parameters:
name(String):
Returns:
public IEnumerable<TScript> EnumerateActorsOfScript<TScript>(Boolean canBeDerived)
Parameters:
canBeDerived(Boolean):
Returns:
public IEnumerable<Actor> EnumerateActorsWithComponent<TComponent>(TComponent component)
Parameters:
component(TComponent):
Returns:
public Void RemoveActor(Actor actor)
Parameters:
actor(Actor):
protected virtual Void Dispose(Boolean disposing)
Parameters:
disposing(Boolean):
protected virtual Void Finalize()
public Void Dispose()
Summary
Releases all scene resources and destroys all actors.