SSTUTools.TextureSet.loadTextureSets C# (CSharp) Method

loadTextureSets() public static method

public static loadTextureSets ( ConfigNode textureSetNodes ) : SSTUTools.TextureSet[]
textureSetNodes System.ConfigNode
return SSTUTools.TextureSet[]
        public static TextureSet[] loadTextureSets(ConfigNode[] textureSetNodes)
        {
            int len = textureSetNodes.Length;
            List<TextureSet> sets = new List<TextureSet>();
            TextureSet set;
            for (int i = 0; i < len; i++)
            {
                String name = textureSetNodes[i].GetStringValue("name");
                set = getTextureSet(textureSetNodes[i].GetStringValue("name"));
                if (set == null) { MonoBehaviour.print("ERROR: Could not locate texture set for name: " + name); }
                else { sets.Add(set); }
            }
            return sets.ToArray();
        }

Usage Example

Ejemplo n.º 1
0
        public override void OnStart(StartState state)
        {
            base.OnStart(state);
            mpf = part.GetComponent <ModuleProceduralFairing>();
            ConfigNode node = SSTUStockInterop.getPartModuleConfig(part, this);

            textureSets = TextureSet.loadTextureSets(node.GetNodes("TEXTURESET"));
            int len = textureSets.Length;

            string[] textureSetNames = new string[len];
            for (int i = 0; i < len; i++)
            {
                textureSetNames[i] = textureSets[i].setName;
            }
            this.updateUIChooseOptionControl("currentTextureSet", textureSetNames, textureSetNames, true, currentTextureSet);
            techLimitMaxDiameter = SSTUStockInterop.getTechLimit(techLimitSet);
            if (currentDiameter > techLimitMaxDiameter)
            {
                currentDiameter = techLimitMaxDiameter;
            }
            updateModelScale();
            updateTexture(currentTextureSet);
            updateNodePositions(false);
            float max = techLimitMaxDiameter < maxDiameter ? techLimitMaxDiameter : maxDiameter;

            this.updateUIFloatEditControl("currentDiameter", minDiameter, max, diameterIncrement * 2f, diameterIncrement, diameterIncrement * 0.05f, true, currentDiameter);
            Fields["currentDiameter"].uiControlEditor.onFieldChanged   = onDiameterUpdated;
            Fields["currentTextureSet"].uiControlEditor.onFieldChanged = onTextureUpdated;
            Fields["currentTextureSet"].guiActiveEditor = textureSets.Length > 1;
            updateEditorFields();
        }
All Usage Examples Of SSTUTools.TextureSet::loadTextureSets