private void setToMeshConfig(int index) { if (meshConfigurations == null) { print("ERROR: NO MESH CONFIG FOR PART: " + part); } if (index < 0 || index >= meshConfigurations.Length) { index = 0; } currentConfiguration = index; MeshConfig config = meshConfigurations[index]; meshDisplayName = config.variantName; currentConfig = config; int len = meshConfigurations.Length; for (int i = 0; i < len; i++) { if (i == index) { continue; } meshConfigurations[i].disable(); } currentConfig.enable(HighLogic.LoadedSceneIsFlight || HighLogic.LoadedSceneIsEditor); }
private void loadConfigFromNode(ConfigNode node) { ConfigNode[] variantNodes = node.GetNodes("MESHVARIANT"); MeshConfig[] cfgs = new MeshConfig[variantNodes.Length]; for (int i = 0; i < cfgs.Length; i++) { cfgs[i] = new MeshConfig(variantNodes[i], part); } meshConfigurations = cfgs; }