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 Thread.RunLater on how to safely call this from an asynchronous thread. Failure to comply with this can cause catastrophical failures as the engine is not designed for this.
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 Void Reparent(Actor newParent, Actor child)
Parameters:
public Actor CreateEmptyActor(String? name, Boolean isStationary)
Parameters:
Returns:
public PropScript? InvokeProp<TProp>(Object? payload)
Summary: Instantiates a prop from a script.
Parameters:
payload(Object?): Optional script payload that is provided in the PropScript.OnCreate function
Returns:
- PropScript?: A valid prop if the instantiation was NOT veto'd
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 the ActorScript.OnCreate function
Returns:
- Actor?: A valid actor if the instantiation was NOT veto'd
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 KillActor(Actor actor)
Parameters:
actor(Actor):
public Void KillProp(PropScript prop)
Parameters:
prop(PropScript):
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.