Search Results for

    Show / Hide Table of Contents

    Class Actor

    Base class for all actor objects on the scene.

    Inheritance
    System.Object
    Object
    SceneObject
    Actor
    AudioListener
    AudioSource
    BoneSocket
    BoxBrush
    BoxVolume
    Camera
    Cloth
    Decal
    EmptyActor
    EnvironmentProbe
    ExponentialHeightFog
    Foliage
    Joint
    Light
    ModelInstanceActor
    NavLink
    NavMesh
    ParticleEffect
    PhysicsColliderActor
    Ragdoll
    RigidBody
    Scene
    SceneAnimationPlayer
    Sky
    Skybox
    Spline
    SplineRopeBody
    SpriteRender
    TextRender
    UICanvas
    UIControl
    VideoPlayer
    Implements
    ISerializable
    Inherited Members
    SceneObject.SetParent(Actor, Boolean)
    SceneObject.LinkPrefab(Guid, Guid)
    SceneObject.BreakPrefabLink()
    SceneObject.GetNamePath(Char)
    SceneObject.IsDuringPlay
    SceneObject.HasParent
    SceneObject.HasPrefabLink
    SceneObject.PrefabID
    SceneObject.PrefabObjectID
    Object.__unmanagedPtr
    Object.__internalId
    Object.Finalize()
    Object.As<T>()
    Object.NewValue(Type)
    Object.New(String)
    Object.Find<T>(Guid, Boolean)
    Object.Find(Guid, Type, Boolean)
    Object.TryFind<T>(Guid)
    Object.TryFind(Guid, Type)
    Object.Destroy(Object, Single)
    Object.DestroyNow(Object)
    Object.Destroy<T>(T, Single)
    Object.Equals(Object)
    Object.GetUnmanagedPtr(Object)
    Object.GetUnmanagedInterface(Object, Type)
    Object.FromUnmanagedPtr(IntPtr)
    Object.MapObjectID(Guid)
    Object.RemapObjectID(Guid)
    Object.GetHashCode()
    Object.ID
    Object.TypeName
    Namespace: FlaxEngine
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    [Unmanaged]
    public abstract class Actor : SceneObject, ISerializable

    Constructors

    Actor()

    Initializes a new instance of the Actor.

    Declaration
    protected Actor()

    Properties

    Box

    Gets actor bounding box that defines 3D space intersecting with the actor (for determination of the visibility for actor).

    Declaration
    [Unmanaged]
    public BoundingBox Box { get; }
    Property Value
    BoundingBox

    BoxWithChildren

    Gets actor bounding box of the actor including all child actors (children included in recursive way)

    Declaration
    [Unmanaged]
    public BoundingBox BoxWithChildren { get; }
    Property Value
    BoundingBox

    Children

    List with all child actors attached to the actor (readonly). All items are valid (not null).

    Declaration
    [Unmanaged]
    public Actor[] Children { get; }
    Property Value
    Actor[]

    EditorBox

    Gets actor bounding box (single actor, no children included) for editor tools.

    Declaration
    [Unmanaged]
    public BoundingBox EditorBox { get; }
    Property Value
    BoundingBox

    EditorBoxChildren

    Gets actor bounding box of the actor including all child actors for editor tools.

    Declaration
    [Unmanaged]
    public BoundingBox EditorBoxChildren { get; }
    Property Value
    BoundingBox

    HasContentLoaded

    Returns true if actor has loaded content.

    Declaration
    [Unmanaged]
    public bool HasContentLoaded { get; }
    Property Value
    System.Boolean

    IsActive

    Gets or sets value indicating if actor is active in the scene.

    Declaration
    [EditorDisplay("General", null)]
    [EditorOrder(-70)]
    [Unmanaged]
    public bool IsActive { get; set; }
    Property Value
    System.Boolean

    IsPrefabRoot

    Gets a value indicating whether this actor is a prefab instance root object.

    Declaration
    [Unmanaged]
    public bool IsPrefabRoot { get; }
    Property Value
    System.Boolean

    IsStatic

    Returns true if object is fully static on the scene, otherwise false.

    Declaration
    [Unmanaged]
    [Tooltip("Returns true if object is fully static on the scene, otherwise false.")]
    public bool IsStatic { get; }
    Property Value
    System.Boolean

    IsTransformStatic

    Returns true if object has static transform.

    Declaration
    [Unmanaged]
    [Tooltip("Returns true if object has static transform.")]
    public bool IsTransformStatic { get; }
    Property Value
    System.Boolean

    Layer

    Gets or sets the object layer (index). Can be used for selective rendering or ignoring raycasts.

    Declaration
    [NoAnimate]
    [EditorDisplay("General", null)]
    [EditorOrder(-69)]
    [CustomEditorAlias("FlaxEditor.CustomEditors.Editors.ActorLayerEditor")]
    [Unmanaged]
    public int Layer { get; set; }
    Property Value
    System.Int32

    LocalOrientation

    Gets or sets local rotation of the actor in parent actor space.

    Declaration
    [EditorDisplay("Transform", "Rotation")]
    [VisibleIf("ShowTransform", false)]
    [EditorOrder(-20)]
    [NoSerialize]
    [CustomEditorAlias("FlaxEditor.CustomEditors.Editors.ActorTransformEditor+OrientationEditor")]
    [Unmanaged]
    public Quaternion LocalOrientation { get; set; }
    Property Value
    Quaternion

    LocalPosition

    Gets or sets local position of the actor in parent actor space.

    Declaration
    [EditorDisplay("Transform", "Position")]
    [VisibleIf("ShowTransform", false)]
    [EditorOrder(-30)]
    [NoSerialize]
    [CustomEditorAlias("FlaxEditor.CustomEditors.Editors.ActorTransformEditor+PositionEditor")]
    [Unmanaged]
    public Vector3 LocalPosition { get; set; }
    Property Value
    Vector3

    LocalScale

    Gets or sets local scale vector of the actor in parent actor space.

    Declaration
    [EditorDisplay("Transform", "Scale")]
    [VisibleIf("ShowTransform", false)]
    [Limit(-3.40282347E+38F, 3.40282347E+38F, 0.01F)]
    [EditorOrder(-10)]
    [NoSerialize]
    [CustomEditorAlias("FlaxEditor.CustomEditors.Editors.ActorTransformEditor+ScaleEditor")]
    [Unmanaged]
    public Float3 LocalScale { get; set; }
    Property Value
    Float3

    LocalToWorldMatrix

    Gets the matrix that transforms a point from the local space of the actor to world space.

    Declaration
    public Matrix LocalToWorldMatrix { get; }
    Property Value
    Matrix

    Name

    Gets or sets the actor name.

    Declaration
    [NoAnimate]
    [EditorDisplay("General", null)]
    [EditorOrder(-100)]
    [Unmanaged]
    public string Name { get; set; }
    Property Value
    System.String

    PerInstanceRandom

    Gets the random per-instance value (normalized to range 0-1).

    Declaration
    [Unmanaged]
    public float PerInstanceRandom { get; }
    Property Value
    System.Single

    Sphere

    Gets actor bounding sphere that defines 3D space intersecting with the actor (for determination of the visibility for actor).

    Declaration
    [Unmanaged]
    public BoundingSphere Sphere { get; }
    Property Value
    BoundingSphere

    StaticFlags

    Gets or sets the actor static flags.

    Declaration
    [NoAnimate]
    [EditorDisplay("General", null)]
    [EditorOrder(-80)]
    [CustomEditorAlias("FlaxEditor.CustomEditors.Editors.ActorStaticFlagsEditor")]
    [Unmanaged]
    public StaticFlags StaticFlags { get; set; }
    Property Value
    StaticFlags

    Tags

    Actor tags collection.

    Declaration
    [NoAnimate]
    [EditorDisplay("General", null)]
    [EditorOrder(-68)]
    [Unmanaged]
    public Tag[] Tags { get; set; }
    Property Value
    Tag[]

    WorldToLocalMatrix

    Gets the matrix that transforms a point from the world space to local space of the actor.

    Declaration
    public Matrix WorldToLocalMatrix { get; }
    Property Value
    Matrix

    Methods

    AddChild(Type)

    Creates a new child actor of the given type.

    Declaration
    public Actor AddChild(Type type)
    Parameters
    System.Type type

    Type of the actor.

    Returns
    Actor

    The child actor.

    AddChild<T>()

    Creates a new child actor of the given type.

    Declaration
    public T AddChild<T>()
        where T : Actor
    Returns
    T

    The child actor.

    Type Parameters
    T

    Type of the actor to search for. Includes any actors derived from the type.

    AddMovement(Vector3)

    Moves the actor (also can rotate it) in world space.

    Declaration
    [Unmanaged]
    public void AddMovement(Vector3 translation)
    Parameters
    Vector3 translation

    The translation vector.

    AddMovement(Vector3, Quaternion)

    Moves the actor (also can rotate it) in world space.

    Declaration
    [Unmanaged]
    public virtual void AddMovement(Vector3 translation, Quaternion rotation)
    Parameters
    Vector3 translation

    The translation vector.

    Quaternion rotation

    The rotation quaternion.

    AddScript(Type)

    Creates a new script of a specific type and adds it to the actor.

    Declaration
    public Script AddScript(Type type)
    Parameters
    System.Type type

    Type of the script to create.

    Returns
    Script

    The created script instance, null otherwise.

    AddScript<T>()

    Creates a new script of a specific type and adds it to the actor.

    Declaration
    public T AddScript<T>()
        where T : Script
    Returns
    T

    The created script instance, null otherwise.

    Type Parameters
    T

    Type of the script to search for. Includes any scripts derived from the type.

    AddStaticFlags(StaticFlags)

    Adds the actor static flags.

    Declaration
    [Unmanaged]
    [Tooltip("Adds the actor static flags.")]
    public void AddStaticFlags(StaticFlags flags)
    Parameters
    StaticFlags flags

    The flags to add.

    AddTag(Tag)

    Adds a tag to the actor

    Declaration
    [Unmanaged]
    public void AddTag(Tag tag)
    Parameters
    Tag tag

    The tag to add.

    AddTagRecursive(Tag)

    Adds a tag to the actor and for all underlying child actors.

    Declaration
    [Unmanaged]
    public void AddTagRecursive(Tag tag)
    Parameters
    Tag tag

    The tag to add.

    Clone()

    Clones actor including all scripts and any child actors (whole scene tree). Objects are duplicated via serialization (any transient/non-saved state is ignored).

    Declaration
    [Unmanaged]
    public Actor Clone()
    Returns
    Actor

    DestroyChildren(Single)

    Destroys the children. Calls Object.Destroy on every child actor and unlinks them for this actor.

    Declaration
    [NoAnimate]
    [Unmanaged]
    public void DestroyChildren(float timeLeft = 0F)
    Parameters
    System.Single timeLeft

    The time left to destroy object (in seconds).

    FindActor(String)

    Tries to find the actor with the given name in this actor hierarchy (checks this actor and all children hierarchy).

    Declaration
    [Unmanaged]
    public Actor FindActor(string name)
    Parameters
    System.String name

    The name of the actor.

    Returns
    Actor

    Actor instance if found, null otherwise.

    FindActor(Type, Tag, Boolean)

    Tries to find the actor of the given type and tag in this actor hierarchy.

    Declaration
    [Unmanaged]
    public Actor FindActor([TypeReference] Type type, Tag tag, bool activeOnly = false)
    Parameters
    System.Type type

    Type of the actor to search for. Includes any actors derived from the type. Supports interface types.

    Tag tag

    The tag of the actor to search for.

    System.Boolean activeOnly

    Finds only an active actor.

    Returns
    Actor

    Actor instance if found, null otherwise.

    FindActor(Type, Boolean)

    Tries to find the actor of the given type in this actor hierarchy (checks this actor and all children hierarchy).

    Declaration
    [Unmanaged]
    public Actor FindActor([TypeReference] Type type, bool activeOnly = false)
    Parameters
    System.Type type

    Type of the actor to search for. Includes any actors derived from the type. Supports interface types.

    System.Boolean activeOnly

    Finds only a active actor.

    Returns
    Actor

    Actor instance if found, null otherwise.

    FindActor(Type, String)

    Tries to find the actor of the given type and name in this actor hierarchy (checks this actor and all children hierarchy).

    Declaration
    [Unmanaged]
    public Actor FindActor([TypeReference] Type type, string name)
    Parameters
    System.Type type

    Type of the actor to search for. Includes any actors derived from the type. Supports interface types.

    System.String name

    The name of the actor.

    Returns
    Actor

    Actor instance if found, null otherwise.

    FindActor<T>(Tag, Boolean)

    Tries to find actor of the given type and tag in this actor hierarchy (checks this actor and all children hierarchy).

    Declaration
    public T FindActor<T>(Tag tag, bool activeOnly = false)
        where T : Actor
    Parameters
    Tag tag

    A tag on the object.

    System.Boolean activeOnly

    Finds only an active actor.

    Returns
    T

    Actor instance if found, null otherwise.

    Type Parameters
    T

    Type of the object.

    FindActor<T>(Boolean)

    Tries to find the actor of the given type in this actor hierarchy (checks this actor and all children hierarchy).

    Declaration
    public T FindActor<T>(bool activeOnly = false)
        where T : Actor
    Parameters
    System.Boolean activeOnly

    Finds only a active actor.

    Returns
    T

    Actor instance if found, null otherwise.

    Type Parameters
    T

    Type of the object.

    FindActor<T>(String)

    Tries to find the actor of the given type and name in this actor hierarchy (checks this actor and all children hierarchy).

    Declaration
    public T FindActor<T>(string name)
        where T : Actor
    Parameters
    System.String name

    Name of the object.

    Returns
    T

    Actor instance if found, null otherwise.

    Type Parameters
    T

    Type of the object.

    FindScript(Type)

    Tries to find the script of the given type in this actor hierarchy (checks this actor and all children hierarchy).

    Declaration
    [Unmanaged]
    public Script FindScript([TypeReference] Type type)
    Parameters
    System.Type type

    Type of the actor to search for. Includes any actors derived from the type. Supports interface types.

    Returns
    Script

    Script instance if found, null otherwise.

    FindScript<T>()

    Tries to find the script of the given type in this actor hierarchy (checks this actor and all children hierarchy).

    Declaration
    public T FindScript<T>()
        where T : class
    Returns
    T

    Script instance if found, null otherwise.

    Type Parameters
    T

    Type of the object.

    FromBytes(Byte[])

    Performs actors deserialization from the raw bytes.

    Declaration
    [Unmanaged]
    public static Actor[] FromBytes(byte[] data)
    Parameters
    System.Byte[] data

    The input data.

    Returns
    Actor[]

    The output actors.

    FromBytes(Byte[], Dictionary<Guid, Guid>)

    Performs actors deserialization from the raw bytes.

    Declaration
    [Unmanaged]
    public static Actor[] FromBytes(byte[] data, Dictionary<Guid, Guid> idsMapping)
    Parameters
    System.Byte[] data

    The input data.

    System.Collections.Generic.Dictionary<System.Guid, System.Guid> idsMapping

    The serialized objects Ids mapping. Can be used to convert the spawned objects ids and references to them.

    Returns
    Actor[]

    The output actors.

    FromJson(String)

    Deserializes the actor object to the Json string. Deserialized are only this actor properties but no child actors nor scripts.

    Declaration
    [Unmanaged]
    public void FromJson(string json)
    Parameters
    System.String json

    The serialized actor data (state).

    GetChild(Int32)

    Gets the child actor at the given index.

    Declaration
    [Unmanaged]
    public Actor GetChild(int index)
    Parameters
    System.Int32 index

    The child actor index.

    Returns
    Actor

    The child actor (always valid).

    GetChild(String)

    Gets the child actor with the given name.

    Declaration
    [Unmanaged]
    public Actor GetChild(string name)
    Parameters
    System.String name

    The child actor name.

    Returns
    Actor

    The child actor or null.

    GetChild(Type)

    Gets the child actor of the given type.

    Declaration
    [Unmanaged]
    public Actor GetChild([TypeReference] Type type)
    Parameters
    System.Type type

    Type of the actor to search for. Includes any actors derived from the type. Supports interface types.

    Returns
    Actor

    The child actor or null.

    GetChild<T>()

    Finds the child actor of the given type.

    Declaration
    public T GetChild<T>()
        where T : Actor
    Returns
    T

    The child actor or null if failed to find.

    Type Parameters
    T

    Type of the actor to search for. Includes any actors derived from the type.

    GetChildren(Type)

    Gets the child actors of the given type.

    Declaration
    [Unmanaged]
    public Actor[] GetChildren([TypeReference] Type type)
    Parameters
    System.Type type

    Type of the actor to search for. Includes any actors derived from the type. Supports interface types.

    Returns
    Actor[]

    The child actors.

    GetChildren<T>()

    Searches for all actors of a specific type in this actor children list.

    Declaration
    public T[] GetChildren<T>()
        where T : Actor
    Returns
    T[]

    All actors matching the specified type

    Type Parameters
    T

    Type of the actor to search for. Includes any actors derived from the type.

    GetLocalToWorldMatrix(out Matrix)

    Gets the matrix that transforms a point from the local space of the actor to world space.

    Declaration
    [Unmanaged]
    public void GetLocalToWorldMatrix(out Matrix localToWorld)
    Parameters
    Matrix localToWorld

    The world to local matrix.

    GetOrAddChild<T>()

    Finds the child actor of the given type or creates a new one.

    Declaration
    public T GetOrAddChild<T>()
        where T : Actor
    Returns
    T

    The child actor.

    Type Parameters
    T

    Type of the actor to search for. Includes any actors derived from the type.

    GetPrefabRoot()

    Gets the root of the prefab this actor is attached to.

    Declaration
    [Unmanaged]
    public Actor GetPrefabRoot()
    Returns
    Actor

    The root prefab object, or null if this actor is not a prefab.

    GetScript(Int32)

    Gets the script at the given index.

    Declaration
    [Unmanaged]
    public Script GetScript(int index)
    Parameters
    System.Int32 index

    The script index.

    Returns
    Script

    The script (always valid).

    GetScript(Type)

    Gets the script of the given type from this actor.

    Declaration
    [Unmanaged]
    public Script GetScript([TypeReference] Type type)
    Parameters
    System.Type type

    Type of the script to search for. Includes any scripts derived from the type. Supports interface types.

    Returns
    Script

    The script or null.

    GetScript<T>()

    Finds the script of the given type from this actor.

    Declaration
    public T GetScript<T>()
        where T : class
    Returns
    T

    The script or null if failed to find.

    Type Parameters
    T

    Type of the script to search for. Includes any scripts derived from the type.

    GetScripts(Type)

    Gets the scripts of the given type from this actor.

    Declaration
    [Unmanaged]
    public Script[] GetScripts([TypeReference] Type type)
    Parameters
    System.Type type

    Type of the script to search for. Includes any scripts derived from the type. Supports interface types.

    Returns
    Script[]

    The scripts.

    GetScripts<T>()

    Searches for all scripts of a specific type from this actor.

    Declaration
    public T[] GetScripts<T>()
        where T : class
    Returns
    T[]

    All scripts matching the specified type.

    Type Parameters
    T

    Type of the scripts to search for. Includes any scripts derived from the type.

    GetWorldToLocalMatrix(out Matrix)

    Gets the matrix that transforms a point from the world space to local space of the actor.

    Declaration
    [Unmanaged]
    public void GetWorldToLocalMatrix(out Matrix worldToLocal)
    Parameters
    Matrix worldToLocal

    The world to local matrix.

    HasActorInChildren(Actor)

    Try to find actor in child actors structure.

    Declaration
    [Unmanaged]
    public bool HasActorInChildren(Actor a)
    Parameters
    Actor a

    The actor to find.

    Returns
    System.Boolean

    Found actor or null.

    HasActorInHierarchy(Actor)

    Try to find actor in hierarchy structure.

    Declaration
    [Unmanaged]
    public bool HasActorInHierarchy(Actor a)
    Parameters
    Actor a

    The actor to find.

    Returns
    System.Boolean

    Found actor or null.

    HasStaticFlag(StaticFlags)

    Returns true if object has given flag(s) set.

    Declaration
    [Unmanaged]
    [Tooltip("Returns true if object has given flag(s) set.")]
    public bool HasStaticFlag(StaticFlags flag)
    Parameters
    StaticFlags flag

    The flag(s) to check.

    Returns
    System.Boolean

    True if has flag(s) set, otherwise false.

    HasTag()

    Determines whether this actor has any tag assigned.

    Declaration
    [Unmanaged]
    public bool HasTag()
    Returns
    System.Boolean

    HasTag(Tag)

    Determines whether this actor has given tag assigned (exact match).

    Declaration
    [Unmanaged]
    public bool HasTag(Tag tag)
    Parameters
    Tag tag

    The tag to check.

    Returns
    System.Boolean

    HasTag(String)

    Determines whether this actor has given tag assigned (exact match).

    Declaration
    [Unmanaged]
    public bool HasTag(string tag)
    Parameters
    System.String tag

    The tag to check.

    Returns
    System.Boolean

    Intersects(Ray, out Single, out Vector3)

    Determines if there is an intersection between the current object or any it's child and a ray.

    Declaration
    [Unmanaged]
    public Actor Intersects(Ray ray, out float distance, out Vector3 normal)
    Parameters
    Ray ray

    The ray to test.

    System.Single distance

    When the method completes, contains the distance of the intersection (if any valid).

    Vector3 normal

    When the method completes, contains the intersection surface normal vector (if any valid).

    Returns
    Actor

    The target hit actor that is the closest to the ray.

    IntersectsItself(Ray, out Single, out Vector3)

    Determines if there is an intersection between the current object and a ray.

    Declaration
    [Unmanaged]
    public virtual bool IntersectsItself(Ray ray, out float distance, out Vector3 normal)
    Parameters
    Ray ray

    The ray to test.

    System.Single distance

    When the method completes, contains the distance of the intersection (if any valid).

    Vector3 normal

    When the method completes, contains the intersection surface normal vector (if any valid).

    Returns
    System.Boolean

    True whether the two objects intersected, otherwise false.

    LookAt(Vector3)

    Rotates actor to orient it towards the specified world position.

    Declaration
    [Unmanaged]
    public void LookAt(Vector3 worldPos)
    Parameters
    Vector3 worldPos

    The world position to orient towards.

    LookAt(Vector3, Vector3)

    Rotates actor to orient it towards the specified world position with upwards direction.

    Declaration
    [Unmanaged]
    public void LookAt(Vector3 worldPos, Vector3 worldUp)
    Parameters
    Vector3 worldPos

    The world position to orient towards.

    Vector3 worldUp

    The up direction that constrains up axis orientation to a plane this vector lies on. This rule might be broken if forward and up direction are nearly parallel.

    LookingAt(Vector3)

    Gets rotation of the actor oriented towards the specified world position.

    Declaration
    [Unmanaged]
    public Quaternion LookingAt(Vector3 worldPos)
    Parameters
    Vector3 worldPos

    The world position to orient towards.

    Returns
    Quaternion

    LookingAt(Vector3, Vector3)

    Gets rotation of the actor oriented towards the specified world position with upwards direction.

    Declaration
    [Unmanaged]
    public Quaternion LookingAt(Vector3 worldPos, Vector3 worldUp)
    Parameters
    Vector3 worldPos

    The world position to orient towards.

    Vector3 worldUp

    The up direction that constrains up axis orientation to a plane this vector lies on. This rule might be broken if forward and up direction are nearly parallel.

    Returns
    Quaternion

    OnActiveChanged()

    Called when actor active state gets changed.

    Declaration
    [Unmanaged]
    public virtual void OnActiveChanged()

    OnActiveInTreeChanged()

    Called when actor active in tree state gets changed.

    Declaration
    [Unmanaged]
    public virtual void OnActiveInTreeChanged()

    OnBeginPlay()

    Called when adding object to the game.

    Declaration
    [NoAnimate]
    [Unmanaged]
    public virtual void OnBeginPlay()

    OnDebugDraw()

    Draws debug shapes for the actor and all child scripts.

    Declaration
    [Unmanaged]
    public virtual void OnDebugDraw()

    OnDebugDrawSelected()

    Draws debug shapes for the selected actor and all child scripts.

    Declaration
    [Unmanaged]
    public virtual void OnDebugDrawSelected()

    OnDisable()

    Called when actor gets removed from game systems. Occurs on EndPlay event or when actor gets inactivated in hierarchy. Use this event to unregister object from other game system (eg. audio).

    Declaration
    [Unmanaged]
    public virtual void OnDisable()

    OnEnable()

    Called when actor gets added to game systems. Occurs on BeginPlay event or when actor gets activated in hierarchy. Use this event to register object to other game system (eg. audio).

    Declaration
    [Unmanaged]
    public virtual void OnEnable()

    OnEndPlay()

    Called when removing object from the game.

    Declaration
    [NoAnimate]
    [Unmanaged]
    public virtual void OnEndPlay()

    OnLayerChanged()

    Called when layer gets changed.

    Declaration
    [Unmanaged]
    public virtual void OnLayerChanged()

    OnOrderInParentChanged()

    Called when order in parent children array gets changed.

    Declaration
    [Unmanaged]
    public virtual void OnOrderInParentChanged()

    OnParentChanged()

    Called when actor parent gets changed.

    Declaration
    [Unmanaged]
    public virtual void OnParentChanged()

    OnStaticFlagsChanged()

    Called when actor static flag gets changed.

    Declaration
    [Unmanaged]
    public virtual void OnStaticFlagsChanged()

    OnTransformChanged()

    Called when actor transform gets changed.

    Declaration
    [Unmanaged]
    public virtual void OnTransformChanged()

    RemoveStaticFlags(StaticFlags)

    Removes the actor static flags.

    Declaration
    [Unmanaged]
    [Tooltip("Removes the actor static flags.")]
    public void RemoveStaticFlags(StaticFlags flags)
    Parameters
    StaticFlags flags

    The flags to remove.

    RemoveTag(Tag)

    Removes a tag to the actor

    Declaration
    [Unmanaged]
    public void RemoveTag(Tag tag)
    Parameters
    Tag tag

    The tag to remove.

    ResetLocalTransform()

    Resets actor local transform.

    Declaration
    public void ResetLocalTransform()

    RotateAround(Vector3, Vector3, Single, Boolean)

    Rotates the actor around axis passing through point in world-space by angle (in degrees).

    Declaration
    public void RotateAround(Vector3 point, Vector3 axis, float angle, bool orientActor = true)
    Parameters
    Vector3 point

    The point (world-space).

    Vector3 axis

    The axis (normalized).

    System.Single angle

    The angle (in degrees).

    System.Boolean orientActor

    Whether to orient the actor the same amount as rotation.

    Remarks

    Modifies both the position and the rotation of the actor (scale remains the same).

    SetLayerNameRecursive(String)

    Sets the name of the layer recursively for actor and for all underlying child actors.

    Declaration
    [Unmanaged]
    public void SetLayerNameRecursive(string value)
    Parameters
    System.String value

    SetLayerRecursive(Int32)

    Sets the layer recursively for all underlying children.

    Declaration
    [Unmanaged]
    public void SetLayerRecursive(int layerIndex)
    Parameters
    System.Int32 layerIndex

    The index of the layer.

    SetParent(Actor, Boolean, Boolean)

    Sets a actor parent.

    Declaration
    [Unmanaged]
    public void SetParent(Actor value, bool worldPositionsStays, bool canBreakPrefabLink)
    Parameters
    Actor value

    New parent

    System.Boolean worldPositionsStays

    Should actor world positions remain the same after parent change?

    System.Boolean canBreakPrefabLink

    True if can break prefab link on changing the parent.

    SetStaticFlag(StaticFlags, Boolean)

    Sets a single static flag to the desire value.

    Declaration
    [Unmanaged]
    [Tooltip("Sets a single static flag to the desire value.")]
    public void SetStaticFlag(StaticFlags flag, bool value)
    Parameters
    StaticFlags flag

    The flag to change.

    System.Boolean value

    The target value of the flag.

    ToBytes(Actor[])

    Performs actors serialization to the raw bytes.

    Declaration
    [Unmanaged]
    public static byte[] ToBytes(Actor[] actors)
    Parameters
    Actor[] actors

    The actors to serialize.

    Returns
    System.Byte[]

    The output data, empty if failed.

    ToJson()

    Serializes the actor object to the Json string. Serialized are only this actor properties but no child actors nor scripts. Serializes references to the other objects in a proper way using IDs.

    Declaration
    [Unmanaged]
    public string ToJson()
    Returns
    System.String

    The Json container with serialized actor data.

    ToString()

    Declaration
    public override string ToString()
    Returns
    System.String

    TryGetChild<T>(out T)

    Tries to the child actor of the given type.

    Declaration
    public bool TryGetChild<T>(out T actor)
        where T : Actor
    Parameters
    T actor

    The returned actor, valid only if method returns true.

    Returns
    System.Boolean

    True if found an child actor of that type or false if failed to find.

    Type Parameters
    T

    Type of the actor to search for. Includes any actors derived from the type.

    TryGetScript<T>(out T)

    Tries to find the script of the given type from this actor.

    Declaration
    public bool TryGetScript<T>(out T script)
        where T : class
    Parameters
    T script

    The returned script, valid only if method returns true.

    Returns
    System.Boolean

    True if found a script of that type or false if failed to find.

    Type Parameters
    T

    Type of the script to search for. Includes any scripts derived from the type.

    TryGetSerializedObjectsIds(Byte[])

    Tries the get serialized objects ids from the raw bytes.

    Declaration
    [Unmanaged]
    public static Guid[] TryGetSerializedObjectsIds(byte[] data)
    Parameters
    System.Byte[] data

    The data.

    Returns
    System.Guid[]

    The output array of serialized object ids.

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.RawClone<T>(T)
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat