private IEnumerator attack(HeroRabbit rabit) { Animator animator = GetComponent <Animator>(); playAttackMusic(); animator.SetBool("attack", true); rabit.removeHealth(1); yield return(new WaitForSeconds(0.8f)); playAttackMusic(); animator.SetBool("attack", false); }
public override void OnRabbitEnter(HeroRabbit rab) { Debug.Log("before " + rab.health); if (rab.health == 2) { rab.removeHealth(1); Debug.Log("not dead?" + rab.health); rab.onHealthChange(); this.hideCollectable(); } else if (rab.health < rab.MaxHealth) { Debug.Log("the hell " + rab.health); rabbit = rab; touched = true; rab.dead = true; } }
protected override void OnRabbitHit(HeroRabbit rabit) { rabit.removeHealth(1); this.CollectedHide(); }