void OnTriggerEnter2D(Collider2D other) { if (curWg == 3 && other.gameObject.tag == "punchWagonColl") // punch수레 범위안에 { wagon.punch(); } }
void OnTriggerStay2D(Collider2D other) { if ((m_num == 0 || m_num == 1 || m_num == 3) && other.gameObject.tag == "Player" && player.GhostTime == 0 && player.isSuper == false) // Player Attack { player.StartCoroutine("PlayerAttack"); StartCoroutine("RockDie"); } if ((m_num == 4 || m_num == 5) && other.gameObject.tag == "Player" && player.GhostTime == 0 && player.isSuper == false) // Player Attack { player.StartCoroutine("PlayerAttack"); } if (curWg == 3 && other.gameObject.tag == "punchWagonColl") // punch수레 범위안에 { wagon.punch(); } if (other.gameObject.tag == "Player" && player.isSuper == true && isAlive == true) { if (PlayerPrefs.GetInt("music") == 1) { JumpAttack.Play(); } Instantiate(GM.Effect[0], transform.position, transform.rotation); Damage = 9999f; StartCoroutine("Hit"); player.StartCoroutine("Vibe"); } if (other.gameObject.tag == "Player" && isAlive == true && m_num == 2) // 얼음 벽 { StartCoroutine("IceWallDie"); } }
void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.tag == "Player" && player.GhostTime == 0 && isAlive == true) // Player Attack { player.StartCoroutine("PlayerAttack"); player.rigid.AddForce(new Vector2(-6, 2), ForceMode2D.Impulse); } if (curWg == 3 && other.gameObject.tag == "punchWagonColl") // punch수레 범위안에 { wagon.punch(); } if (isAlive && Jumping && other.gameObject.tag == "Ground") { if (PlayerPrefs.GetInt("music") == 1) { Explosion.Play(); } Instantiate(GM.Effect[7], transform.position + dustPos[0], transform.rotation); Instantiate(GM.Effect[7], transform.position + dustPos[1], transform.rotation); for (int i = 0; i < 3; i++) { player.StartCoroutine("Vibe"); } if (player.DogState.transform.GetChild(2).gameObject.activeSelf == true && player.GhostTime == 0 && isAlive == true) // player가 뛰지 않았을 때 { player.StartCoroutine("PlayerAttack"); } Jumping = false; } }
void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.tag == "JumpAttackColl" && player.rigid.velocity.y < 0) // Jump Attack 당함 { if (PlayerPrefs.GetInt("music") == 1) { JumpAttack.Play(); } Instantiate(GM.Effect[0], transform.position, transform.rotation); Damage = GM.Get_JumpDamage(); KnockBack = 0; if (curCh == 3) // 포메 밟기 데미지 +2 { Damage += 2; } StartCoroutine("Hit"); player.StartCoroutine("Vibe"); if (player.isSuper == false) { player.rigid.velocity = new Vector2(rigid.velocity.x, 8f); player.StartCoroutine("JumpAttackGhost"); } } if (curWg == 3 && other.gameObject.tag == "punchWagonColl") // punch수레 범위안에 { wagon.punch(); } if (other.gameObject.tag == "Player" && player.GhostTime == 0 && player.isSuper == false && isAlive == true) // Player Attack { player.StartCoroutine("PlayerAttack"); } if (other.gameObject.tag == "Player" && player.isSuper == true && isAlive == true) // super attack { if (PlayerPrefs.GetInt("music") == 1) { JumpAttack.Play(); } Instantiate(GM.Effect[0], transform.position, transform.rotation); Damage = 9999f; StartCoroutine("Hit"); player.StartCoroutine("Vibe"); HPbar.SetActive(false); } }