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 Threads.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.

Important

This class MUST be disposed manually.

Definition

Namespace: SDT4.Managed.Core
Assembly: SDT4.Managed.Core.dll

class Scene
Inheritance:

Object ➔ Scene

Implements:

IDisposable, IDisposeTracker<Scene>

Fields

Name Type Description

Properties

Name Type Description
public get; NativeHandle IntPtr Throws an ObjectDisposedException if this is null.
public get; Name String
NativeHandle Remarks

Warning

Not for public access, usually not needed anyway.


Methods

public static Scene CreateEmptyScene(String? name)

Summary: Creates an empty scene with no actors.

Parameters:

Returns:


public Void Start()


public Void Stop()


public Void Reparent(Actor newParent, Actor child)

Parameters:


public Actor CreateEmptyActor(String? name, Boolean isStationary)

Parameters:

Returns:


public Actor? CreatePrefabActor(PrefabAsset 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:

Returns:


public Actor? GetActorFromId(UInt64 id)

Summary: Gets an actor from an ID relative to the scene root.

Parameters:

Returns:


public Actor? GetActorFromGuid(Guid guid)

Summary: Gets an actor from an absolute GUID.

Parameters:

Returns:


public IEnumerable<TScript> EnumerateActorsOfScript<TScript>(Boolean canBeDerived)

Parameters:

Returns:


public IEnumerable<Actor> EnumerateActorsWithComponent<TComponent>(TComponent component)

Parameters:

Returns:


public Void KillActor(Actor actor)

Parameters:


public Void Dispose()

Summary: Releases all scene resources and destroys all actors.


public virtual Boolean Equals(Object? obj)

Parameters:

Returns:


public virtual Int32 GetHashCode()

Returns:


public virtual String ToString()

Returns: