1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
using BehaviorTreeEngine; public class NewTreeRootNode : TreeRootNode { void Awake() { // Init node properties from xml files Init(0, 0, ""); // Register this mono behavior node with its distinct composite (forest, tree) indices BtEngine.MonoBehaviorNode.Register(forestIndex, treeIndex, this); } // Use this for initialization void Start () { } // Update is called once per frame void Update () { } public override void OnExecute(uint AccuLoopCount) { // Put your code here to be invoked when this node is getting executed } public override void OnReport(NodeStatus Status, uint AccuLoopCount) { // Put your code here to be invoked when this node is getting reported } public override void OnNotify(NotifyStatus Status, uint NodeIndex, uint AccuLoopCount) { // Put your code here to be invoked when this node is getting notified } public override void OnConstruct() { // Put your code here to be invoked when this node is getting loaded // Option to invoke child nodes' OnConstruct foreach (var childNode in BtEngine.MonoBehaviorNode.GetEnumerable(forestIndex, treeIndex)) childNode.Item2.OnConstruct(); } public override void OnDestruct() { // Put your code here to be invoked when this node is getting destroyed // Option to invoke child nodes' OnDestruct foreach (var childNode in BtEngine.MonoBehaviorNode.GetEnumerable(forestIndex, treeIndex)) childNode.Item2.OnDestruct(); } public override void OnPause() { // Put your code here to be invoked when this node is getting paused // Option to invoke child nodes' OnPause foreach (var childNode in BtEngine.MonoBehaviorNode.GetEnumerable(forestIndex, treeIndex)) childNode.Item2.OnPause(); } public override void OnStop() { // Put your code here to be invoked when this node is getting stopped // Option to invoke child nodes' OnStop foreach (var childNode in BtEngine.MonoBehaviorNode.GetEnumerable(forestIndex, treeIndex)) childNode.Item2.OnStop(); } public override void OnReset() { // Put your code here to be invoked when this node is getting reset // Option to invoke child nodes' OnReset foreach (var childNode in BtEngine.MonoBehaviorNode.GetEnumerable(forestIndex, treeIndex)) childNode.Item2.OnReset(); } } |
Copyright © 2016-2020 Qualgame, LLC