Ejemplo n.º 1
0
 public Result BTUpdate(BehaviorTreeExecutor behaviorTreeExecutor)
 {
     switch (result)
     {
     case Result.Running:
         result = root.BTUpdate(behaviorTreeExecutor);
         break;
     }
     return(result);
 }
Ejemplo n.º 2
0
        public override Result OnUpdate(BehaviorTreeExecutor behaviorTreeExecutor)
        {
            GameObject obj = behaviorTreeExecutor.GetGameObjectVariable(objectID);

            if (Physics.Linecast(behaviorTreeExecutor.transform.position, obj.transform.position, out RaycastHit hit, viewObstructingLayers))
            {
                if (hit.collider.gameObject != obj)
                {
                    UnityEngine.Debug.DrawLine(behaviorTreeExecutor.transform.position, hit.point, Color.red);
                    return(Result.Failure);
                }
            }
            UnityEngine.Debug.DrawLine(behaviorTreeExecutor.transform.position, obj.transform.position, Color.green);
            return(Result.Success);
        }
Ejemplo n.º 3
0
        public override Result OnUpdate(BehaviorTreeExecutor behaviorTreeExecutor)
        {
            for (; i < children.Count; i++)
            {
                Result result = children[i].BTUpdate(behaviorTreeExecutor);
                switch (result)
                {
                case Result.Success:
                    i = 0;
                    return(result);

                case Result.Failure:
                    break;

                case Result.Running:
                    return(result);

                default:
                    break;
                }
            }
            i = 0;
            return(Result.Failure);
        }
Ejemplo n.º 4
0
 public override Result OnUpdate(BehaviorTreeExecutor behaviorTreeExecutor)
 {
     return(child.BTUpdate(behaviorTreeExecutor));
 }