Search Results for

    Show / Hide Table of Contents

    Class Behavior

    Behavior instance script that runs Behavior Tree execution.

    Inheritance
    System.Object
    Object
    SceneObject
    Script
    Behavior
    Implements
    ISerializable
    Inherited Members
    Script.OnAwake()
    Script.OnEnable()
    Script.OnDisable()
    Script.OnDestroy()
    Script.OnStart()
    Script.OnUpdate()
    Script.OnLateUpdate()
    Script.OnFixedUpdate()
    Script.OnLateFixedUpdate()
    Script.OnDebugDraw()
    Script.OnDebugDrawSelected()
    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
    [Category("Flax Engine")]
    [Unmanaged]
    public class Behavior : Script, ISerializable

    Constructors

    Behavior()

    Initializes a new instance of the Behavior.

    Declaration
    public Behavior()

    Properties

    AutoStart

    If checked, auto starts the logic on begin play.

    Declaration
    [EditorOrder(10)]
    [Unmanaged]
    public bool AutoStart { get; set; }
    Property Value
    System.Boolean

    Knowledge

    Gets the current behavior knowledge instance. Empty if not started.

    Declaration
    [Unmanaged]
    public BehaviorKnowledge Knowledge { get; }
    Property Value
    BehaviorKnowledge

    Result

    Gets the last behavior tree execution result.

    Declaration
    [Unmanaged]
    public BehaviorUpdateResult Result { get; }
    Property Value
    BehaviorUpdateResult

    System

    The system for behaviors update.

    Declaration
    [Unmanaged]
    public static TaskGraphSystem System { get; }
    Property Value
    TaskGraphSystem

    Tree

    Behavior Tree asset to use for logic execution.

    Declaration
    [EditorOrder(0)]
    [Unmanaged]
    public BehaviorTree Tree { get; set; }
    Property Value
    BehaviorTree

    UpdateRateScale

    The behavior logic update rate scale (multiplies the UpdateFPS defined in Behavior Tree root node). Can be used to improve performance via LOD to reduce updates frequency (eg. by 0.5) for behaviors far from player.

    Declaration
    [EditorOrder(20)]
    [Limit(0F, 10F, 0.01F)]
    [Unmanaged]
    public float UpdateRateScale { get; set; }
    Property Value
    System.Single

    Methods

    ResetLogic()

    Resets the behavior logic by clearing knowledge (clears blackboard and removes goals) and resetting execution state (goes back to root).

    Declaration
    [Unmanaged]
    public void ResetLogic()

    StartLogic()

    Starts the logic.

    Declaration
    [Unmanaged]
    public void StartLogic()

    StopLogic(BehaviorUpdateResult)

    Stops the logic.

    Declaration
    [Unmanaged]
    public void StopLogic(BehaviorUpdateResult result)
    Parameters
    BehaviorUpdateResult result

    The logic result.

    Events

    Finished

    Event called when behavior tree execution ends with a result.

    Declaration
    [Unmanaged]
    public event Action Finished
    Event Type
    System.Action

    Extension Methods

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