void AttackState() { if (!enemy.IsDead) { CharacterCommands.Attack(chara, enemy); } else { enemy = null; } }
// 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); } } }