/// <summary> /// Find the simulator in flight or editor /// </summary> public void FindData() { if (HighLogic.LoadedSceneIsFlight) { activeVessel = FlightGlobals.ActiveVessel; SystemHeatVessel heatVessel = activeVessel.GetComponent <SystemHeatVessel>(); if (heatVessel != null) { simulator = heatVessel.Simulator; } partCount = activeVessel.Parts.Count; if (SystemHeatSettings.DebugUI) { Utils.Log("[Debug UI]: Located Flight data"); } } if (HighLogic.LoadedSceneIsEditor) { if (simulator == null) { simulator = SystemHeatEditor.Instance.Simulator; if (simulator != null && SystemHeatSettings.DebugUI) { Utils.Log("[Debug UI]: Located Editor data"); } } } }
protected void FindSimulator(Vessel v) { if (HighLogic.LoadedSceneIsEditor) { simulator = SystemHeatEditor.Instance.Simulator; } if (HighLogic.LoadedSceneIsFlight) { SystemHeatVessel heatVessel = v.GetComponent <SystemHeatVessel>(); if (heatVessel != null) { simulator = heatVessel.Simulator; } Utils.Log($"[SystemHeatOverlay]: Located Flight data on vessel {v.vesselName}", LogType.UI); } }
protected void FindSimulator() { if (HighLogic.LoadedSceneIsEditor) { simulator = SystemHeatEditor.Instance.Simulator; } if (HighLogic.LoadedSceneIsFlight) { SystemHeatVessel heatVessel = FlightGlobals.ActiveVessel.GetComponent <SystemHeatVessel>(); if (heatVessel != null) { simulator = heatVessel.Simulator; } if (SystemHeatSettings.DebugUI) { Utils.Log($"[SystemHeatOverlay]: Located Flight data on vessel {FlightGlobals.ActiveVessel.vesselName}"); } } }
public void AssignSimulator(SystemHeatSimulator sim) { simulator = sim; }