Exemple #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("몬스터 생성 사운드");
     }
 }