// 공 격 중 스 킬 전 체 스 킬 void OnTriggerStay2D(Collider2D other) { if (_eMushRoomState.Idle == _state) { if (other.gameObject.layer == LayerMask.NameToLayer("Ground_MonsterLayer")) { Collider2D[] others = Physics2D.OverlapCircleAll(transform.position, 1.5f, 1 << 9); for (int i = 0; i < others.Length; i++) { cBarteriaBase monster = others [i].gameObject.GetComponent <cBarteriaBase> (); monster._HpDown(_skillvalue); monster._EffectHurt(monster.transform.position); } _state = _eMushRoomState.Attack; } } }
public override void _VirtualAnimation() { base._VirtualAnimation(); switch (_state) { case _eMushRoomState.Idle: _time += Time.deltaTime; if (_time >= _idletime) { int random = Random.Range(0, 2); _animator.SetTrigger(string.Format("{0}{1}", "_isidle", random.ToString())); _time = 0; } break; case _eMushRoomState.Attack: _animator.SetTrigger("_isattack"); _Gravity.enabled = false; _collider.enabled = false; _ConenuMonster.gameObject.SetActive(false); //텁 _sound.PlayOneShot(_clip[0]); _state = _eMushRoomState.Attacking; _time = 0; break; case _eMushRoomState.Attacking: _time += Time.deltaTime; if (_time > _attacktime) { //소화 시킴 hp에 따라 if (_skillvalue >= _ConenuMonster.GetComponent <cBarteriaBase> ()._nHp) { _ConenuMonster.gameObject.SetActive(true); _ConenuMonster._HpDown(9999); //텁 _sound.PlayOneShot(_clip[2]); } else { _sound.PlayOneShot(_clip[1]); if (_ConenuMonster.GetComponent <cSkillSlow> ()) { Destroy(_ConenuMonster.GetComponent <cSkillSlow> ()); } _ConenuMonster.gameObject.SetActive(true); _ConenuMonster.GetComponent <cBarteriaBase> ()._EffectHurtStart(); _ConenuMonster.gameObject.AddComponent <cSkill2> (); } _time = 0; _state = _eMushRoomState.Delay; } break; case _eMushRoomState.Delay: _Gravity.enabled = false; _state = _eMushRoomState.Delayiing; break; case _eMushRoomState.Delayiing: _time += Time.deltaTime; if (_time > _delay) { _Gravity.enabled = true; _collider.enabled = true; _state = _eMushRoomState.Idle; _time = 0; } break; case _eMushRoomState.Seal: _Gravity.enabled = false; _collider.enabled = false; _time = 0; _state = _eMushRoomState.Sealing; break; case _eMushRoomState.Sealing: break; } }