Skip to content

Tree

Tree

Access Behave.Runtime.Tree

Description
The Tree class is an abstract class from which each compiled Behave tree in your library inherits. It is the interface you will use to communicate with the tree instances you receive from your library class.

Methods
BehaveResult Tick ([IAgent agent, object data]);
void Reset ([IAgent agent, object data]);
void SetInitForward (int id, TickForward init);
void SetInitForward (int id, TickForwardShort init);
void SetTickForward (int id, TickForward tick);
void SetTickForward (int id, TickForwardShort tick);
void SetResetForward (int id, ResetForward reset);
void SetResetForward (int id, ResetForwardShort reset);

Properties
int ActiveContext { get; } // A context can be set by a component at any time and remains in place until another context is set or the tree tick ends. Subtrees inherit contexts.
float Frequency { get; } // The frequency is set in the tree designer, but has no impact on the runtime apart from the return value of this property
int ActiveID { get; } // In a tick or init call on an agent, this will be the ID of the action or decorator
// These are set *after* execution of a tick method on an agent:
int LastTicked { get; }
int LastTickedAction { get; set; }
int LastTickedDecorator { get; set; }
float LastTickTime { get; } // This is grabbed from UnityEngine.Time.time
bool DebugAvailable { get; }
// If the above returns true, then debug is available and these get updated:
string Name { get; }
int ActiveComponent { get; }

No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS

*

Spam protection by WP Captcha-Free