SSTUTools.SSTUModularBooster.updateMainModelFromEditor C# (CSharp) Method

updateMainModelFromEditor() private method

Updates the main-segment model from user input in the editor
private updateMainModelFromEditor ( String newModel, bool updateSymmetry ) : void
newModel String
updateSymmetry bool
return void
        private void updateMainModelFromEditor(String newModel, bool updateSymmetry)
        {
            SRBModelData mod = Array.Find(mainModules, m => m.name == newModel);
            if (mod != null && mod != currentMainModule)
            {
                currentMainModule.destroyCurrentModel();
                currentMainModule = mod;
                currentMainModule.setupModel(part.transform.FindRecursive(baseTransformName), ModelOrientation.CENTRAL);
            }
            currentMainName = currentMainModule.name;
            if (!currentMainModule.isValidTextureSet(currentMainTexture))
            {
                currentMainTexture = currentMainModule.getDefaultTextureSet();
            }
            currentMainModule.enableTextureSet(currentMainTexture);
            currentMainModule.updateTextureUIControl(this, "currentMainTexture", currentMainTexture);
            updateModelScaleAndPosition();
            updateEffectsScale();
            updateContainerVolume();
            updatePartMass();
            updatePartCost();
            updateAttachnodes(true);
            updateEditorValues();
            updateThrustOutput();
            updateGui();
            if (updateSymmetry)
            {
                foreach (Part p in part.symmetryCounterparts)
                {
                    p.GetComponent<SSTUModularBooster>().updateMainModelFromEditor(newModel, false);
                }
            }
            SSTUStockInterop.fireEditorUpdate();
            SSTUModInterop.onPartGeometryUpdate(part, true);
        }