void OnTriggerEnter(Collider other) { //leuchtenden Ring durch Tunnel schicken TriggerEnter.OnTriggerEnter(other); var main = ps.main; if (other.gameObject.name == "Coin_new(Clone)") { main.startColor = blue; } else if (other.gameObject.name == "Structure_subdiv2(Clone)") { main.startColor = red; } else if (other.gameObject.name == "Boni(Clone)") { main.startColor = green; } ps.Play(); }
void OnTriggerEnter(Collider other) { var main = psh.main; if (other.gameObject.name == "Coin_new(Clone)") { main.startColor = blue; } else if (other.gameObject.name == "Structure_subdiv2(Clone)") { main.startColor = red; } else if (other.gameObject.name == "Boni(Clone)") { main.startColor = green; } StartCoroutine(PlayAnimation()); psh.Play(); TriggerEnter.OnTriggerEnter(other); }