public void OnTriggerEnter(Collider other) { if (other.CompareTag("Star") == true) { combo.ScoreUp(10); sm.SoundPlay((int)MJ.AudioClipName.Item); Destroy(other.gameObject); } else { var tmpCheckColor = other.transform.GetComponent <Renderer>().material.color; Debug.LogFormat("tmpColor = " + tmpCheckColor.ToString() + "okColor = " + spwanManger.Ok.ToString()); if (spwanManger.Ok == tmpCheckColor) { combo.ScoreUp(10); sm.SoundPlay((int)MJ.AudioClipName.Item); //lbj.SpwanManager.count++; Destroy(other.gameObject); } else { lbj.SpwanManager.isSpwan = false; manager.GameOver(); DestroyAllOBJ(); Destroy(other.gameObject); } } //if (other.gameObject.tag == "Enemy") // 에너미 태그가 ok //{ // combo.ScoreUp(10); // sm.SoundPlay((int)MJ.AudioClipName.Item); // //lbj.SpwanManager.count++; // Destroy(other.gameObject); //} //if (other.gameObject.tag == "Coin") //코인 테그가 No //{ // //Destroy(other.gameObject); // lbj.SpwanManager.isSpwan = false; // manager.GameOver(); // DestroyAllOBJ(); // Destroy(other.gameObject); //} }
public void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Enemy") { //Destroy(other.gameObject); DestroyAllOBJ(); manager.GameOver(); lbj.SpwanManager.isSpwan = false; } if (other.gameObject.tag == "Coin") { combo.ScoreUp(10); sm.SoundPlay((int)MJ.AudioClipName.Item); //Destroy(other.gameObject); //lbj.SpwanManager.count++; } Destroy(other.gameObject); }