private void OnCollisionStay(Collision collision) { if (collision.gameObject.layer == LayerMask.NameToLayer("Hazard")) { List <SoundStruct> temporary_list = new List <SoundStruct>() { parameter_test }; SoundFactory.DeleteSound(ref temporary_list, "event:/enginetest"); Application.LoadLevel(Application.loadedLevel + 2); } else if (collision.gameObject.layer == LayerMask.NameToLayer("Goal")) { List <SoundStruct> temporary_list = new List <SoundStruct>() { parameter_test }; SoundFactory.DeleteSound(ref temporary_list, "event:/enginetest"); Application.LoadLevel(Application.loadedLevel + 1); } else if (collision.gameObject.layer == LayerMask.NameToLayer("Navigation")) { NavigationPath pathfinding = collision.gameObject.GetComponent <NavigationPath>(); if (pathfinding != null) { next_navigation = pathfinding; } } }