Esempio n. 1
0
    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);
    }
Esempio n. 2
0
    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;
        }
    }
Esempio n. 3
0
 protected override void OnRabbitHit(HeroRabbit rabit)
 {
     rabit.removeHealth(1);
     this.CollectedHide();
 }