//Creates the corresponding system to index value public void OnDropBox_PresetsChanged() { int value = DropboxPreMadeSystems.value; Gravity_PremadeSystems temp = new Gravity_PremadeSystems(); switch (value) { //Custom system case 0: OnResetClicked(); break; //Earth Moon system case 1: temp.EarthMoonSystem(); break; //Eclipse System case 2: temp.EclipseSystem(); break; //Hyperbolic encounter case 3: temp.HyperbolicEncounter(); break; } }
//Resets the scene public void OnResetClicked() { //Resets the static variables for simulations newSimulateController.isSimulating = false; newSimulateController.SimulationSpeed = 1; newParticle.ParticleInstances.Clear(); Gravity_PremadeSystems.DestroyObjectsWithTag("Particle"); //Loads scene to refresh values SceneManager.LoadScene("GravityScene"); }