Class BehaviorTreeNode
Base class for Behavior Tree nodes.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/AI/BehaviorTreeNode.h
Syntax
public class BehaviorTreeNode : public SerializableScriptingObject
Fields
_executionIndex
Declaration
protected int32 _executionIndex = -1
Field Value
int32
|
_memoryOffset
Declaration
protected int32 _memoryOffset = 0
Field Value
int32
|
_parent
Name
Node user name (eg. Follow Enemy, or Pick up Weapon).
Declaration
public String Name
Field Value
String
|
Methods
BecomeIrrelevant(const BehaviorUpdateContext& context)
Declaration
public virtual void BecomeIrrelevant(const BehaviorUpdateContext& context)
Parameters
BehaviorUpdateContext
context
|
BecomeRelevant(const BehaviorUpdateContext& context)
Declaration
public virtual void BecomeRelevant(const BehaviorUpdateContext& context)
Parameters
BehaviorUpdateContext
context
|
Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)
Deserializes object from the input stream.
Declaration
public virtual void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override
Parameters
DeserializeStream
stream
The input stream. |
ISerializeModifier
modifier
The deserialization modifier object. Always valid. |
Overrides
GetDebugInfo(const BehaviorUpdateContext& context)
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
public virtual String GetDebugInfo(const BehaviorUpdateContext& context) const
Parameters
BehaviorUpdateContext
context
Behavior context data. |
Returns
String
Debug info text (multiline). |
GetState(void* memory)
Declaration
public T* GetState(void* memory) const
Parameters
void
memory
|
Returns
T
|
Type Parameters
typename 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
public virtual int32 GetStateSize() const
Returns
int32
|
Init(BehaviorTree* tree)
Initializes node state. Called after whole tree is loaded and nodes hierarchy is setup.
Declaration
public virtual void Init(BehaviorTree* tree)
Parameters
BehaviorTree
tree
Node owner asset. |
InitState(const BehaviorUpdateContext& context)
Initializes node instance state. Called when starting logic simulation for a given behavior. Call constructor of the state container.
Declaration
public virtual void InitState(const BehaviorUpdateContext& context)
Parameters
BehaviorUpdateContext
context
Behavior update context data. |
InvokeUpdate(const BehaviorUpdateContext& context)
Declaration
public BehaviorUpdateResult InvokeUpdate(const BehaviorUpdateContext& context)
Parameters
BehaviorUpdateContext
context
|
Returns
BehaviorUpdateResult
|
ReleaseState(const BehaviorUpdateContext& context)
Cleanups node instance state. Called when stopping logic simulation for a given behavior. Call destructor of the state container.
Declaration
public virtual void ReleaseState(const BehaviorUpdateContext& context)
Parameters
BehaviorUpdateContext
context
Behavior update context data. |
Serialize(SerializeStream& stream, const void* otherObj)
Serializes object to the output stream compared to the values of the other object instance (eg. default class object). If other object is null then serialize all properties.
Declaration
public virtual void Serialize(SerializeStream& stream, const void* otherObj) override
Parameters
SerializeStream
stream
The output stream. |
void
otherObj
The instance of the object to compare with and serialize only the modified properties. If null, then serialize all properties. |
Overrides
Update(const BehaviorUpdateContext& context)
Updates node logic.
Declaration
public virtual BehaviorUpdateResult Update(const BehaviorUpdateContext& context)
Parameters
BehaviorUpdateContext
context
Behavior update context data. |
Returns
BehaviorUpdateResult
Operation result enum. |