Ejemplo n.º 1
0
 private void OnTriggerEnter(Collider col)
 {
     if (CurrentState == MonsterState.READY)
     {
         return;
     }
     if (col.CompareTag("PWeapon") && CurrentState != MonsterState.DEAD)
     {
         _cmonstersound.HitSound();
         CPlayerManager.Instance.PlusSoul();
         //MHitEffect();
         iEffectCnt++;
         pCameraShake.OnShaking(0.1f, 0.1f,
                                new Vector3(Random.insideUnitSphere.x, Random.insideUnitSphere.y, Random.insideUnitSphere.z), true);
         LeftRightHitEffect();
         _Mstat.CurHP -= CPlayerManager.Instance.GetStat.Damage;
         SetState(MonsterState.HIT);
         StartCoroutine(HitShader());
         _rigid.AddForce(-transform.forward * 3, ForceMode.Impulse);
     }
     else if (col.CompareTag("Bomb") && (CurrentState != MonsterState.READY))
     {
         _rigid.AddForce(-transform.forward * 10, ForceMode.Impulse);
         _Mstat.CurHP -= GameObject.FindWithTag("Plantbomb").GetComponent <PlantManager>().GetStat.Damage;
     }
     else if (col.CompareTag("PSkill"))// 몬스터 쳐맞았을때
     {
         _cmonstersound.UltHitSound();
         LeftRightHitEffect();
         _Mstat.CurHP -= CPlayerManager.Instance.GetStat.SkillDamage;
     }
     else if (col.CompareTag("PSkillEvent"))
     {
         SetState(MonsterState.SLOW);
         //isHitSkill();
         StartCoroutine(MonsterStop());
     }
     else if (col.CompareTag("SlowSkill"))
     {
         //StartCoroutine(HitSlowSkill());
         _SlowEffect.gameObject.SetActive(true);
         _Mstat.CurSlowTime = _Mstat.MaxSlowTime;
         bSlow = true;
     }
     else if (col.CompareTag("RushSkill"))
     {
         _cmonstersound.HitSound();
         SetState(MonsterState.HIT);
         pCameraShake.OnShaking(0.3f, 0.3f,
                                new Vector3(Random.insideUnitSphere.x, Random.insideUnitSphere.y, Random.insideUnitSphere.z), true);
         LeftRightHitEffect();
         //MHitEffect();
         _Mstat.CurHP -= CPlayerManager.Instance.GetStat.RushDamage;
     }
     else if (col.CompareTag("Search") && CurrentState != MonsterState.READY)
     {
         _cmonstersound.MonsterVoice();  //Debug.Log("몬스터 생성 사운드");
     }
 }
Ejemplo n.º 2
0
    private void OnTriggerEnter(Collider col)
    {
        if (CurrentState == BossState.DEAD)
        {
            return;
        }

        switch (col.tag)
        {
        case "PWeapon":
            CPlayerManager.Instance.PlusSoul();
            CBossSound.Instance._BossHitSound();
            MHitEffect();
            pCameraShake.OnShaking(0.3f, 0.3f,
                                   new Vector3(Random.insideUnitSphere.x, Random.insideUnitSphere.y, Random.insideUnitSphere.z), true);
            _stat.CurHP -= CPlayerManager.Instance.GetStat.Damage;
            StartCoroutine(HitShader());

            if (!FenceManager._isSlow)
            {
                _skillcount++;
            }

            UIManager.Instance.TargetHitHpColor();
            break;

        case "PSkillEvent":
            if (PrevState != BossState.DEAD)
            {
                SetState(BossState.HIT);
            }
            StartCoroutine(HitShader());
            break;

        case "PSkill":
            _stat.CurHP -= CPlayerManager.Instance.GetStat.SkillDamage;
            MHitEffect();
            CBossSound.Instance._BossHitSound();
            StartCoroutine(HitShader());
            MHitEffect();
            UIManager.Instance.TargetHitHpColor();
            break;

        case "RushSkill":
            CBossSound.Instance._BossHitSound();
            pCameraShake.OnShaking(0.2f, 0.1f,
                                   new Vector3(Random.insideUnitSphere.x, Random.insideUnitSphere.y, 0), true);
            MHitEffect();
            _stat.CurHP -= CPlayerManager.Instance.GetStat.RushDamage;
            break;

        case "SlowSkill":
            //StartCoroutine(HitSlowSkill());
            bSlow             = true;
            _stat.CurSlowTime = _stat.MaxSlowTime;
            break;

        case "GameOver":
            gameObject.SetActive(false);
            UIManager.isGameOver = true;
            break;
        }
    }