private void CreateVesselSection(IVesselSection section) { if (VesselPrefab == null || VesselTransform == null) { return; } GameObject sectionObject = Instantiate(VesselPrefab); if (sectionObject == null) { return; } sectionObject.transform.SetParent(VesselTransform, false); SEP_VesselSection vSection = sectionObject.GetComponent <SEP_VesselSection>(); if (vSection == null) { return; } vSection.setVessel(section); currentVessel = vSection; }
public void removeVesselSection(IVesselSection section) { if (section == null) { return; } for (int i = currentVessels.Count - 1; i >= 0; i--) { SEP_VesselSection v = currentVessels[i]; if (v == null) { continue; } if (v.ID != section.ID) { continue; } currentVessels.RemoveAt(i); Destroy(v.gameObject); break; } }
public void SetCurrentBody(string body) { if (windowInterface == null) { return; } for (int i = currentVessels.Count - 1; i >= 0; i--) { SEP_VesselSection vessel = currentVessels[i]; if (vessel == null) { continue; } vessel.gameObject.SetActive(false); Destroy(vessel.gameObject); } for (int i = currentBodies.Count - 1; i >= 0; i--) { SEP_CelestialBodyObject b = currentBodies[i]; if (b == null) { continue; } if (b.Body == body) { continue; } b.DisableBody(); } var vessels = windowInterface.GetBodyVessels(body); if (vessels.Count <= 0) { return; } currentBody = body; windowInterface.CurrentBody = body; CreateVesselSections(vessels); }
public void setExperiment(IExperimentSection experiment, SEP_VesselSection vessel) { if (experiment == null) { return; } if (vessel == null) { return; } parent = vessel; experimentInterface = experiment; if (Title != null) { Title.text = experiment.Name; } if (Remaining != null) { Remaining.text = experimentInterface.DaysRemaining; } if (ToggleBackground != null && PlayIcon != null && PauseIcon != null) { ToggleBackground.sprite = experimentInterface.IsRunning ? PauseIcon : PlayIcon; } if (BaseSlider != null && FrontSlider != null) { BaseSlider.normalizedValue = Mathf.Clamp01(experimentInterface.Calibration); FrontSlider.normalizedValue = Mathf.Clamp01(experimentInterface.Progress); } experimentInterface.setParent(this); }
private void CreateVesselSection(IVesselSection section) { GameObject sectionObject = Instantiate(VesselSectionPrefab); if (sectionObject == null) { return; } windowInterface.ProcessStyle(sectionObject); sectionObject.transform.SetParent(VesselSectionTransform, false); SEP_VesselSection vSection = sectionObject.GetComponent <SEP_VesselSection>(); if (vSection == null) { return; } vSection.setVessel(section, this); }
public void setExperiment(IExperimentSection experiment, SEP_VesselSection vessel) { if (experiment == null) { return; } if (vessel == null) { return; } parent = vessel; experimentInterface = experiment; if (Title != null) { Title.OnTextUpdate.Invoke(experiment.Name); } if (Remaining != null) { Remaining.OnTextUpdate.Invoke(experimentInterface.DaysRemaining); } toggleState = !experimentInterface.IsRunning; UpdateToggleButton(experimentInterface.IsRunning); if (BaseSlider != null && FrontSlider != null) { BaseSlider.normalizedValue = Mathf.Clamp01(experimentInterface.Calibration); FrontSlider.normalizedValue = Mathf.Clamp01(experimentInterface.Progress); } experimentInterface.setParent(this); }