예제 #1
0
 public override void Init(BehaviorBlackboard data)
 {
     base.Init(data);
     if (subTree == null)
     {
         Debug.LogError("Behavor Tree Designer\nNo subtree assigned!");
         return;
     }
     subRoot = subTree.GetRootNode();
     subRoot.Init(data);
 }
        private void Awake()
        {
            if (behaviorTree == null)
            {
                Debug.LogError("Behavor Tree Designer\nNo behavior assigned!");
                return;
            }
            if (agent == null)
            {
                Debug.LogError("Behavor Tree Designer\nNo agent assigned!");
                return;
            }

            data = new BehaviorBlackboard();
            data.Add("_BTD_Agent", agent);
            rootNode = behaviorTree.GetRootNode();
        }
        private void Start()
        {
            if (behaviorTree == null)
            {
                Debug.LogError("Behavor Tree Designer\nNo behavior assigned!");
                return;
            }
            if (agent == null)
            {
                Debug.LogError("Behavor Tree Designer\nNo agent assigned!");
                return;
            }

            data = new BehaviorBlackboard();
            data.Add("Agent", agent);
            rootNode = behaviorTree.GetRootNode();
            rootNode.Init(data);
            InvokeRepeating("DoTick", 0, tickTime);
        }