コード例 #1
0
ファイル: Orc2.cs プロジェクト: zmtrvch/UnityProject
    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);
    }
コード例 #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;
        }
    }
コード例 #3
0
 protected override void OnRabbitHit(HeroRabbit rabit)
 {
     rabit.removeHealth(1);
     this.CollectedHide();
 }