private void AlertedNewTurbineDestroyed(AIJetStreamT242Controller obj) { QuickLogger.Debug("Attempting to remove turbine", true); if (obj != null) { QuickLogger.Debug("OBJ Not NULL", true); Turbines?.Remove(obj.GetPrefabId()); QuickLogger.Debug("Past Turbine", true); _aiMarineMonitorDisplay?.ItemModified(TechType.None); QuickLogger.Debug("Removed Turbine"); } }
private IEnumerator TrackNewTurbineCoroutine(AIJetStreamT242Controller obj) { // We yield to the end of the frame as we need the parent/children tree to update. yield return(new WaitForEndOfFrame()); GameObject newSeaBase = obj?.gameObject?.transform?.parent?.gameObject; QuickLogger.Debug("Attempting to add turbine", true); if (newSeaBase != null && newSeaBase == _seaBase) { Turbines.Add(obj.GetPrefabId(), obj); QuickLogger.Debug($"Turbine Count: {Turbines.Count}", true); _aiMarineMonitorDisplay.ItemModified(TechType.None); } }