void OnCollisionEnter2D(Collision2D other) { if (_count <= 0) { return; } if (_state == _eBarState.UP) { if (other.gameObject.layer == LayerMask.NameToLayer("Ground_MonsterLayer")) { cBarteriaBase monster = other.gameObject.GetComponent <cBarteriaBase> (); if (monster.gameObject.transform.localScale.x >= 2.5f) { return; } if (monster.GetComponent <cSkill8> ()) { monster.gameObject.GetComponent <cSkill8> ()._SetMaximumSize(monster.transform.localScale.x + 0.1f); } else { monster.gameObject.AddComponent <cSkill8> ()._SetMaximumSize(monster.transform.localScale.x + 0.1f); } _count--; _ui._SetCount(_count); _audio.PlayOneShot(_clip [1]); } } }
void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.layer == LayerMask.NameToLayer("Wall_Layer")) { _ReflectWall(other.gameObject.GetComponent <cWall> ()); _ReflectAddPorce(_rigidbody.velocity.magnitude); } else if (other.gameObject.layer == LayerMask.NameToLayer("Ground_PlayerLayer")) { _EffectHurt(other.contacts[0].point); } else if (other.gameObject.layer == LayerMask.NameToLayer("Ground_MonsterLayer")) { if (_skill == _eBarteriaSkill.Return) { cBarteriaBase barteria = other.collider.GetComponent <cBarteriaBase> (); //barteria._HpUp (barteria._nMaxHP * _PercentValue / 100); // Debug.Log(barteria.name); barteria._HpUp(_Skillvalue); GameObject obj = cSkillHealingManager._GetInst()._GetSkill11Effect(); if (obj != null) { obj.transform.parent = barteria.transform; obj.transform.localPosition = Vector2.zero; obj.transform.localScale = Vector2.one; obj.SetActive(true); } _skill = _eBarteriaSkill.Start; } } }
void OnTriggerStay2D(Collider2D other) { if (_eMushRoomState.Attacking == _state) { return; } if (other.gameObject.layer == LayerMask.NameToLayer("Ground_MonsterLayer")) { _distance = Vector3.Distance(transform.position + (Vector3)_collider.offset, other.transform.position); //쓰읍 _sound.clip = _clip [0]; _sound.Play(); if (_distance < 0.5f) { _ConenuMonster = other.GetComponent <cBarteriaBase> (); _ConenuMonster.transform.position = transform.position + (Vector3)_collider.offset; _state = _eMushRoomState.Attack; } } }
public override void _Delete() { base._Delete(); if (_ConenuMonster != null) { _ConenuMonster.gameObject.SetActive(true); _ConenuMonster = null; } }
// 공 격 중 스 킬 전 체 스 킬 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; } } }