Esempio n. 1
0
        private void setTankTextureFromEditor(String newSet, bool updateSymmetry)
        {
            currentTankTexture = newSet;
            currentMainTankModule.enableTextureSet(newSet);

            if (updateSymmetry)
            {
                foreach (Part p in part.symmetryCounterparts)
                {
                    p.GetComponent <SSTUModularFuelTank>().setTankTextureFromEditor(newSet, false);
                }
            }
        }
Esempio n. 2
0
        protected virtual void setMainTankModuleFromEditor(String newMainTank, bool updateSymmetry)
        {
            TankModelData newModule = Array.Find(mainTankModules, m => m.name == newMainTank);

            currentMainTankModule.destroyCurrentModel();
            currentMainTankModule = newModule;
            currentMainTankModule.setupModel(getTankRootTransform(false), ModelOrientation.CENTRAL);
            currentTankType = newModule.name;
            if (!currentMainTankModule.isValidTextureSet(currentTankTexture))
            {
                currentTankTexture = currentMainTankModule.getDefaultTextureSet();
            }
            currentMainTankModule.enableTextureSet(currentTankTexture);
            currentMainTankModule.updateTextureUIControl(this, "currentTankTexture", currentTankTexture);
            updateUIScaleControls();
            updateEditorStats(true);
            lastSelectedVariant = currentMainTankModule.variantName;
            if (updateSymmetry)
            {
                foreach (Part p in part.symmetryCounterparts)
                {
                    p.GetComponent <SSTUModularFuelTank>().setMainTankModuleFromEditor(newMainTank, false);
                }
            }
            SSTUStockInterop.fireEditorUpdate();
            SSTUModInterop.onPartGeometryUpdate(part, true);
        }
 protected virtual void setMainTankModuleFromEditor(String newMainTank, bool updateSymmetry)
 {
     TankModelData newModule = Array.Find(mainTankModules, m => m.name == newMainTank);
     currentMainTankModule.destroyCurrentModel();
     currentMainTankModule = newModule;
     currentMainTankModule.setupModel(getTankRootTransform(false), ModelOrientation.CENTRAL);
     currentTankType = newModule.name;
     if (!currentMainTankModule.isValidTextureSet(currentTankTexture)) { currentTankTexture = currentMainTankModule.getDefaultTextureSet(); }
     currentMainTankModule.enableTextureSet(currentTankTexture);
     currentMainTankModule.updateTextureUIControl(this, "currentTankTexture", currentTankTexture);
     updateUIScaleControls();
     updateEditorStats(true);
     lastSelectedVariant = currentMainTankModule.variantName;
     if (updateSymmetry)
     {
         foreach (Part p in part.symmetryCounterparts)
         {
             p.GetComponent<SSTUModularFuelTank>().setMainTankModuleFromEditor(newMainTank, false);
         }
     }
     SSTUStockInterop.fireEditorUpdate();
     SSTUModInterop.onPartGeometryUpdate(part, true);
 }