Example #1
0
    public void Damaged(int value)
    {
        if (isDead)
        {
            return;
        }


        //if(state == TrainState.IDLE)

        //if (!isDamaged)
        //{
        //    isDamaged = true;
        //    hp -= value;

        //    if (hp <= 0)
        //    {
        //        isDead = true;
        //        anim.SetTrigger("die");
        //    }

        //}
        if (tm.questNumber == 4)
        {
            SoundManager.Instance.SFXPlay2D("Shaman_DieVO");
            isDead = true;
            anim.SetTrigger("die");
            guard.GuardEnd();
        }

        if (!player.isCri) // 약공격
        {
            if (tm.questNumber == 1)
            {
                SoundManager.Instance.SFXPlay2D("Shaman_Hit");
                tm.ChangeQuest();
            }
        }

        else
        {
            if (tm.questNumber == 2)
            {
                SoundManager.Instance.SFXPlay2D("Shaman_Hit");
                tm.ChangeQuest();
                StartCoroutine(ChangeState());

                //isDead = true;
                //StopAllCoroutines();
                //anim.SetTrigger("die");
            }
        }
    }
Example #2
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag.Equals("Enemy") == false)
        {
            if (other.tag.Equals("Player"))
            {
                other.gameObject.GetComponent <Player>().GetDamage(0);

                var  _obj   = other.gameObject.GetComponent <Player>();
                bool _check = _obj.comboAtk.animator.GetBool("isGuardHit");

                if (_check)
                {
                    tm.ChangeQuest();
                    tm.KillMonster();
                }

                EffectManager.Instance.EffectActive(7,
                                                    other.gameObject.GetComponent <Collider>().ClosestPointOnBounds(transform.position),
                                                    Quaternion.identity);
            }
            gameObject.SetActive(false);

            EffectManager.Instance.EffectActive(7,
                                                other.gameObject.GetComponent <Collider>().ClosestPointOnBounds(transform.position),
                                                Quaternion.identity);
        }
    }
Example #3
0
    public void Damaged(int value)
    {
        if (tm.questNumber == 5)
        {
            gameObject.tag = "Untagged";
            tm.ChangeQuest();

            SoundManager.Instance.SFXPlay2D("Portal_Open");
            SoundManager.Instance.SFXPlay("Portal_Loop", portal.transform.position, true);
            portal.SetActive(true);
        }
    }