Ejemplo n.º 1
0
 public void Awake()
 {
     anim = GetComponent<Animator>();
     id = GetComponent<Character.CharacterIdentifier>();
     Fight = GetComponent<Character.CharacterFightScript>();
     anim.SetTrigger("Walk");
 }
Ejemplo n.º 2
0
 public void Fight(CharacterFightScript attacker)
 {
     if(attacker == null || attacker.Health <= 0)
     {
         var walk = GetComponent<CharacterWalk>();
         walk.Walking = true;
         walk.SetwalkAnim();
         return;
     }
     attacker.Health -= Damage;
     StartCoroutine(WaitFight(attacker));
 }
Ejemplo n.º 3
0
 IEnumerator WaitFight(CharacterFightScript attacker)
 {
     yield return new WaitForSeconds(AttackSpeed);
     Fight(attacker);
 }