예제 #1
0
        public override NodeStatus Tick(BehaviorBlackboard data)
        {
            if (this.Outputs[0].connections.Count == 0)
            {
                Debug.LogError("Behavor Tree Designer\nOutput node is not connected on node: " + this.name);
                return(NodeStatus.ERROR);
            }

            BaseBehaviorNode node = (BaseBehaviorNode)this.Outputs[0].connections[0].body;

            if (start)
            {
                data.Add(guid.ToString(), Time.time);
            }

            float time = (float)data.Get(guid.ToString());

            if (time + waitTime > Time.time)
            {
                start = false;
                return(NodeStatus.RUNNING);
            }
            else
            {
                start = true;
                return(node.Tick(data));
            }
        }
예제 #2
0
        public override NodeStatus Tick(BehaviorBlackboard data)
        {
            if (this.Outputs[0].connections.Count == 0)
            {
                Debug.LogError("Behavor Tree Designer\nOutput node is not connected on node: " + this.name);
                return(NodeStatus.ERROR);
            }

            BaseBehaviorNode node   = (BaseBehaviorNode)this.Outputs[0].connections[0].body;
            NodeStatus       status = NodeStatus.SUCCESS;
            int rep = (int)data.Get(guid.ToString());

            status = node.Tick(data);

            if (status == NodeStatus.RUNNING)
            {
                return(status);
            }

            rep += 1;

            if (rep < repNumber)
            {
                status = NodeStatus.RUNNING;
                data.Add(guid.ToString(), rep);
            }
            else
            {
                data.Add(guid.ToString(), 0);
            }

            return(status);
        }
예제 #3
0
        public override NodeStatus Tick(BehaviorBlackboard data)
        {
            if (this.Outputs[0].connections.Count == 0)
            {
                Debug.LogError("Behavor Tree Designer\nRoot node is not connected.");
                return(NodeStatus.ERROR);
            }

            BaseBehaviorNode node = (BaseBehaviorNode)this.Outputs[0].connections[0].body;

            return(node.Tick(data));
        }
예제 #4
0
        public override NodeStatus Tick(BehaviorBlackboard data)
        {
            if (this.Outputs[0].connections.Count == 0)
            {
                Debug.LogError("Behavor Tree Designer\nOutput node is not connected on node: " + this.name);
                return(NodeStatus.ERROR);
            }

            BaseBehaviorNode node   = (BaseBehaviorNode)this.Outputs[0].connections[0].body;
            NodeStatus       status = node.Tick(data);

            Debug.Log("Behavor Tree Designer Logger\nComing from: " + node.name + ". Result: " + status.ToString());

            return(status);
        }
예제 #5
0
        public override NodeStatus Tick(BehaviorBlackboard data)
        {
            if (this.Outputs[0].connections.Count == 0)
            {
                Debug.LogError("Behavor Tree Designer\nOutput node is not connected on node: " + this.name);
                return(NodeStatus.ERROR);
            }

            BaseBehaviorNode node   = (BaseBehaviorNode)this.Outputs[0].connections[0].body;
            NodeStatus       status = node.Tick(data);

            if (status == NodeStatus.SUCCESS)
            {
                status = NodeStatus.FAILURE;
            }
            else if (status == NodeStatus.FAILURE)
            {
                status = NodeStatus.SUCCESS;
            }
            return(status);
        }
 private void DoTick()
 {
     rootNode.Tick(data);
 }
예제 #7
0
 public override NodeStatus Tick(BehaviorBlackboard data)
 {
     return(subRoot.Tick(data));
 }