void OnTriggerEnter2D(Collider2D col) { if (m_isNetworkObject) { return; } //맵 바깥쪽에 도착했다. if (col.transform.tag.Equals("OUTLINE")) { DeleteBullet(); } else { if (col.transform.tag.Equals("ENEMY") && m_curTarget == BULLET_TARGET.PLAYER) { Monster mon = col.GetComponent <Monster>(); GameManager.Instance().SetCurrentEnemy(mon); if (mon.enabled) { mon.Damage(1); } else { NetworkManager.Instance().SendOrderMessage( JSONMessageTool.ToJsonHPUdate(mon.MONSTER_NAME, 1)); } DeleteBullet(); } else if (col.transform.tag.Equals("BOSS") && m_curTarget == BULLET_TARGET.PLAYER) { Stage1BOSS boss = col.GetComponent <Stage1BOSS>(); GameManager.Instance().SetCurrentEnemy(boss); if (boss.enabled) { boss.Damage(8); } else { NetworkManager.Instance().SendOrderMessage( JSONMessageTool.ToJsonDamage(boss.MONSTER_NAME, 8)); } DeleteBullet(); } else if (col.transform.tag.Equals("BOSS2") && m_curTarget == BULLET_TARGET.PLAYER) { Stage2BossBone bone = col.GetComponent <Stage2BossBone>(); GameManager.Instance().SetCurrentEnemy(bone.m_boss2); if (bone.m_boss2.enabled) { bone.m_boss2.Damage(8, bone.name); } else { NetworkManager.Instance().SendOrderMessage( JSONMessageTool.ToJsonDamage(bone.m_boss2.MONSTER_NAME, 8)); } DeleteBullet(); } else if (col.transform.tag.Equals("Player") && m_curTarget == BULLET_TARGET.ENEMY) { // 데미지 받는 처리 //Vector3 bulletPos = transform.position; //Vector3 targetPos = col.transform.position; //Vector3 createPos = Vector3.zero; DeleteBullet(); HeroRobo robo = col.GetComponent <HeroRobo>(); if (robo != null) { robo.Damage(1); } else { Hero hero = col.GetComponent <Hero>(); if (hero != null) { hero.Damage(1); } } } } }