示例#1
0
        protected virtual void setMountModuleFromEditor(String newMountType, bool updateSymmetry)
        {
            MountModelData newModule = Array.Find(mountModules, m => m.name == newMountType);

            currentMountModule.destroyCurrentModel();
            currentMountModule = newModule;
            newModule.setupModel(part, getMountRootTransform(false), ModelOrientation.BOTTOM);
            currentMountType = newModule.name;
            if (!currentMountModule.isValidTextureSet(currentMountTexture))
            {
                currentMountTexture = currentMountModule.getDefaultTextureSet();
            }
            currentMountModule.enableTextureSet(currentMountTexture);
            currentMountModule.updateTextureUIControl(this, "currentMountTexture", currentMountTexture);
            updateEditorStats(true);

            if (updateSymmetry)
            {
                foreach (Part p in part.symmetryCounterparts)
                {
                    p.GetComponent <SSTUModularFuelTank>().setMountModuleFromEditor(newMountType, false);
                }
            }
            SSTUStockInterop.fireEditorUpdate();
            SSTUModInterop.onPartGeometryUpdate(part, true);
        }
示例#2
0
 /// <summary>
 /// Loads or builds the models for the currently selected modules.
 /// </summary>
 private void restoreModels()
 {
     currentMainTankModule.setupModel(part, getTankRootTransform(true), ModelOrientation.CENTRAL);
     currentNoseModule.setupModel(part, getNoseRootTransform(true), ModelOrientation.TOP);
     currentMountModule.setupModel(part, getMountRootTransform(true), ModelOrientation.BOTTOM);
 }
示例#3
0
        private void setNoseModuleFromEditor(MountModelData newModule, bool updateSymmetry)
        {
            currentNoseModule.destroyCurrentModel();
            currentNoseModule = newModule;
            newModule.setupModel(part, part.transform.FindRecursive("model"), ModelOrientation.TOP);
            currentNoseType = newModule.name;
            if (!currentNoseModule.isValidTextureSet(currentNoseTexture)) { currentNoseTexture = currentNoseModule.modelDefinition.defaultTextureSet; }
            currentNoseModule.enableTextureSet(currentNoseTexture);

            updateEditorStats(true);

            if (updateSymmetry)
            {
                foreach (Part p in part.symmetryCounterparts)
                {
                    SSTUModularFuelTank mft = p.GetComponent<SSTUModularFuelTank>();
                    MountModelData mt = Array.Find(mft.noseModules, t => t.name == newModule.name);
                    mft.setNoseModuleFromEditor(mt, false);
                }
            }
        }