Beispiel #1
0
 public void UPDATE()
 {
     //Debug.Log("PatrolState");
     if (baseControll.attack.targetObject != null)
     {
         baseControll.ChangeState(baseControll.baseMovement);
     }
     else
     {
         StartCoroutine(DelayPatrol());
         baseControll.ChangeState(baseControll.baseMovement);
     }
 }
Beispiel #2
0
 public void UPDATE()
 {
     //Debug.Log("AttackState");
     if (targetObject == null)
     {
         baseControll.ChangeState(baseControll.idleState);
     }
     else if (baseControll.baseMovement.ChaseTarget())
     {
         baseControll.ChangeState(baseControll.baseMovement);
     }
     else if (readyAttack)
     {
         AttackCommand();
     }
 }
Beispiel #3
0
 public void UPDATE()
 {
     //Debug.Log("Idle");
     if (baseControll.attack.targetObject != null)
     {
         baseControll.ChangeState(baseControll.baseMovement);
     }
     // Go back to position
     else if (baseControll.baseMovement.TargetDistance(baseControll.baseMovement.StartPosition) > 2)
     {
         baseControll.ChangeState(baseControll.evadeState);
     }
     else
     {
         baseControll.ChangeState(baseControll.patrolState);
     }
 }
Beispiel #4
0
 public void UPDATE()
 {
     //Debug.Log("Evade");
     baseControll.baseMovement.Move(baseControll.baseMovement.StartPosition - baseControll.transform.position);
     if (baseControll.baseMovement.TargetDistance(baseControll.baseMovement.StartPosition) < 2)
     {
         baseControll.ChangeState(baseControll.idleState);
     }
 }