void Awake() { if (LaunchVehicleDropdown.options.Count != LaunchVehicleOptions.Length) { Debug.LogWarning("Number of launch vehicle options does not match " + "number of items in the dropdown"); } // Init new characterization string pair and set defaults sizeNeo = "Medium"; compositionNeo = "Carbonaceous Asteroid (porous rock)"; UpdateNeoCharacterizationText(); // Retrieve defaults LaunchVehicleType = LaunchVehicleOptions[LaunchVehicleDropdown.value]; diameter = DiameterSlider.value / 1000; DiameterText.text = diameter.ToString(); density = DensitySlider.value / 100; DensityText.text = density.ToString(); TryCalculateMass(); // Set density units label (using the superscript '3' character) char super3 = '\u00B3'; DensityUnitsText.text = "g/cm" + super3.ToString(); }
/// <summary> /// Ons the dropdown launch vehicle. /// </summary> /// <param name="index">Index.</param> public void OnLaunchVehicleChanged(int index) { LaunchVehicleType = LaunchVehicleOptions[index]; }