private void assignResourcesToPart(bool calledByPlayer) { // destroying a resource messes up the gui in editor, but not in flight. setupTankInPart(part, calledByPlayer); if (HighLogic.LoadedSceneIsEditor) { for (int s = 0; s < part.symmetryCounterparts.Count; s++) { setupTankInPart(part.symmetryCounterparts[s], calledByPlayer); ModuleAmmoSwitch symSwitch = part.symmetryCounterparts[s].GetComponent <ModuleAmmoSwitch>(); if (symSwitch != null) { symSwitch.selectedTankSetup = selectedTankSetup; } } } //Debug.Log("refreshing UI"); if (tweakableUI == null) { tweakableUI = BDAcTools.FindActionWindow(part); } if (tweakableUI != null) { tweakableUI.displayDirty = true; } else { Debug.Log("no UI to refresh"); } }