Actor

Summary

Represents an entity in the scene hierarchy with associated lifecycle, components, and hierarchy management.

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 catastrophic failures as the engine is not designed for concurrent scene mutation.

Definition

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

class Actor
Inheritance:

Object ➔ Actor

Implements:


Fields

Name Type Description
public readonly Handle ActorHandle The underlying handle referencing this actor instance within its owning scene.

Properties

Name Type Description
public get; NativeHandle UInt32 Gets the underlying native entity identifier.
public get; Scene Scene Gets the scene in which this actor resides.
public get; GlobalId Guid Gets the persistent globally unique identifier of this actor.
public get; ScopeId Guid Gets the unique identifier of the scope hierarchy that contains this actor.
public get; LocalId UInt64 Gets the scope-local identifier of this actor.
public get; Name String Gets the display or debug name of this actor, or if unnamed.
public get; Mobility Mobility Gets the mobility state of this actor (e.g. static, stationary, or dynamic).
public get; IsValid Boolean Gets a value indicating whether the actor represents an active, valid entity within the scene.
public get; ScopeRoot Nullable<ActorHandle> Gets the root actor handle of the current hierarchy scope, or if this actor has no scope root.
public get; Parent Nullable<ActorHandle> Gets the handle of this actor's direct parent in the transform hierarchy, or if it is a root entity.
public get; Children ActorHandle[] Gets an array of handles representing all direct children of this actor in the hierarchy.
public get; Components IActorComponent[] Gets an array containing all components currently attached to this actor.

Methods

public Boolean HasComponent<T>()

Summary: Determines whether this actor has a component of the specified type attached.

Returns:


public T GetComponent<T>()

Summary: Retrieves the attached component of the specified type.

Returns:


public Boolean TryGetComponent<T>(out T component)

Summary: Attempts to retrieve an attached component of the specified type.

Parameters:

Returns:


public T AddComponent<T>()

Summary: Instantiates and attaches a new component of the specified type to this actor.

Returns:


public Boolean RemoveComponent<T>()

Summary: Removes the component of the specified type from this actor.

Returns:


public Nullable<ActorHandle> GetActorByLocalIdInScope(UInt64 localId)

Summary: Resolves an actor handle within the same hierarchy scope matching a scope-local identifier.

Parameters:

Returns:


public ActorHandle CreateEmptyActorInScope(String? name)

Summary: Spawns a new empty actor belonging to the current actor's hierarchy scope.

Parameters:

Returns:


public virtual Boolean Equals(Object? obj)

Summary: Determines whether the specified object is an Actor and matches this instance.

Parameters:

Returns:


public Boolean Equals(Actor other)

Summary: Determines whether the specified Actor references the same native entity and scene.

Parameters:

Returns:


public virtual Int32 GetHashCode()

Summary: Returns the hash code for this actor.

Returns:


public virtual String ToString()

Summary: Returns a formatted string representation of this actor.

Returns: