Пример #1
0
 void AttackState()
 {
     if (!enemy.IsDead)
     {
         CharacterCommands.Attack(chara, enemy);
     }
     else
     {
         enemy = null;
     }
 }
Пример #2
0
 // Update is called once per frame
 void Update()
 {
     if (chara.IsDead)
     {
         return;
     }
     if (!target)
     {
         CharacterCommands.GetVision(chara, players);
     }
     else
     {
         if (Vector2.Distance(transform.position, target.transform.position) <= chara.Weapon.Range)
         {
             CharacterCommands.Attack(chara, target);
         }
     }
 }