Search Results for

    Show / Hide Table of Contents

    Class BehaviorTreeNode

    Base class for Behavior Tree nodes.

    Inheritance
    System.Object
    Object
    SerializableScriptingObject
    BehaviorTreeNode
    BehaviorTreeCompoundNode
    BehaviorTreeDecorator
    BehaviorTreeDelayNode
    BehaviorTreeForceFinishNode
    BehaviorTreeMoveToNode
    BehaviorTreeSubTreeNode
    Implements
    ISerializable
    Inherited Members
    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 BehaviorTreeNode : SerializableScriptingObject, ISerializable

    Constructors

    BehaviorTreeNode()

    Initializes a new instance of the BehaviorTreeNode.

    Declaration
    protected BehaviorTreeNode()

    Properties

    _executionIndex

    Execution index of the node within tree.

    Declaration
    [Unmanaged]
    protected int _executionIndex { get; }
    Property Value
    System.Int32

    _memoryOffset

    Raw memory byte offset from the start of the behavior memory block.

    Declaration
    [Unmanaged]
    protected int _memoryOffset { get; }
    Property Value
    System.Int32

    _parent

    Parent node that owns this node (parent composite or decorator attachment node).

    Declaration
    [Unmanaged]
    protected BehaviorTreeNode _parent { get; }
    Property Value
    BehaviorTreeNode

    Name

    Node user name (eg. Follow Enemy, or Pick up Weapon).

    Declaration
    [Unmanaged]
    public string Name { get; set; }
    Property Value
    System.String

    Methods

    FreeState(IntPtr)

    Frees the allocated node state at the given memory address.

    Declaration
    public void FreeState(IntPtr memory)
    Parameters
    System.IntPtr memory

    GetDebugInfo(BehaviorUpdateContext)

    Gets the node debug state text (multiline). Used in Editor-only to display nodes state. Can be called without valid Behavior/Knowledge/Memory to display default debug info (eg. node properties).

    Declaration
    [Unmanaged]
    public virtual string GetDebugInfo(BehaviorUpdateContext context)
    Parameters
    BehaviorUpdateContext context

    Behavior context data.

    Returns
    System.String

    Debug info text (multiline).

    GetState<T>(IntPtr)

    Returns the typed node state at the given memory address.

    Declaration
    public ref T GetState<T>(IntPtr memory)
        where T : struct, ValueType
    Parameters
    System.IntPtr memory

    Returns
    T

    Type Parameters
    T

    GetStateSize()

    Gets the node instance state size. A chunk of the valid memory is passed via InitState to setup that memory chunk (one per-behavior).

    Declaration
    [Unmanaged]
    public virtual int GetStateSize()
    Returns
    System.Int32

    GetStateSize<T>()

    Gets the size in bytes of the given typed node state structure.

    Declaration
    public static int GetStateSize<T>()
    Returns
    System.Int32

    Type Parameters
    T

    Init(BehaviorTree)

    Initializes node state. Called after whole tree is loaded and nodes hierarchy is setup.

    Declaration
    [Unmanaged]
    public virtual void Init(BehaviorTree tree)
    Parameters
    BehaviorTree tree

    Node owner asset.

    InitState(BehaviorUpdateContext)

    Initializes node instance state. Called when starting logic simulation for a given behavior. Call constructor of the state container.

    Declaration
    [Unmanaged]
    public virtual void InitState(BehaviorUpdateContext context)
    Parameters
    BehaviorUpdateContext context

    Behavior update context data.

    NewState(IntPtr, Object)

    Sets the node state at the given memory address.

    Declaration
    public void NewState(IntPtr memory, object state)
    Parameters
    System.IntPtr memory

    System.Object state

    ReleaseState(BehaviorUpdateContext)

    Cleanups node instance state. Called when stopping logic simulation for a given behavior. Call destructor of the state container.

    Declaration
    [Unmanaged]
    public virtual void ReleaseState(BehaviorUpdateContext context)
    Parameters
    BehaviorUpdateContext context

    Behavior update context data.

    Update(BehaviorUpdateContext)

    Updates node logic.

    Declaration
    [Unmanaged]
    public virtual BehaviorUpdateResult Update(BehaviorUpdateContext context)
    Parameters
    BehaviorUpdateContext context

    Behavior update context data.

    Returns
    BehaviorUpdateResult

    Operation result enum.

    Extension Methods

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