private void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "cube" || other.gameObject.tag == "point") { if (IsValid(other.gameObject)) { if (!Spawner.dropEffect) { PPInGame.Success(); } scoring.CubeDestroyed(); Destroy(other.transform.parent.gameObject); } else { PPInGame.Fail(); scoring.CubeMissed(); if (other.transform.parent && other.transform.parent.GetComponent <Cube>()) { Destroy(other.transform.parent.gameObject); } else { Destroy(other.gameObject); } } } }
private void OnTriggerEnter(Collider other) { Debug.Log(other.gameObject); if (other.gameObject.tag == "death") { PostProcessingInGame.Instance.Fail(); scoring.CubeMissed(); Destroy(gameObject); } }