public override string GetInfo() { if (showInfo) { List <string> list; list = textureNames.Length > 0 ? ParseTools.ParseNames(textureNames) : ParseTools.ParseNames(mapNames); textureDisplayList = ParseTools.ParseNames(textureDisplayNames); var stringBuilder = new StringBuilder(); stringBuilder.AppendLine("Alternate textures available:"); if (Equals(list.Count, 0) && Equals(list.Count, 0)) { stringBuilder.AppendLine("None"); } for (int i = 0; i < list.Count; i++) { if (i > textureDisplayList.Count - 1) { stringBuilder.AppendLine(getTextureDisplayName(list[i])); } else { stringBuilder.AppendLine(textureDisplayList[i]); } } stringBuilder.AppendLine("\nUse the Next Texture button on the right click menu."); return(stringBuilder.ToString()); } return(string.Empty); }
public override void OnStart(StartState state) { if (state == StartState.Editor) { return; } String[] resources_to_supply = { ResourceManager.FNRESOURCE_MEGAJOULES }; this.resources_to_supply = resources_to_supply; base.OnStart(state); part.force_activate(); inputResourceNames = ParseTools.ParseNames(inputResources); inputResourceRate = ParseTools.ParseDoubles(inputConversionRates); outputResourceRate = ParseTools.ParseDoubles(outputConversionRates); }
public override void OnStart(StartState state) { if (state == StartState.Editor) { return; } string[] resources_to_supply = { ResourceSettings.Config.ElectricPowerInMegawatt }; this.resources_to_supply = resources_to_supply; base.OnStart(state); if (forceActivateAtStartup) { part.force_activate(); } inputResourceNames = ParseTools.ParseNames(inputResources); inputResourceRate = ParseTools.ParseDoubles(inputConversionRates); }
void initializeData() { if (initialized) { return; } debug = new InterstellarDebugMessages(debugMode, "InterstellarTextureSwitch2"); objectList = ParseTools.ParseNames(objectNames, true); texList = ParseTools.ParseNames(textureNames, true, true, textureRootFolder); mapList = ParseTools.ParseNames(mapNames, true, true, textureRootFolder); textureDisplayList = ParseTools.ParseNames(textureDisplayNames); debug.debugMessage(string.Concat(new object[] { "found ", texList.Count, " textures, using number ", selectedTexture, ", found ", objectList.Count, " objects, ", mapList.Count, " maps" })); foreach (string current in objectList) { Transform[] array = part.FindModelTransforms(current); var list = new List <Material>(); Transform[] array2 = array; foreach (var transformRef in array2) { if (!Equals(transformRef, null) && !Equals(transformRef.gameObject.renderer, null)) { Material material = transformRef.gameObject.renderer.material; if (!Equals(material, null) && !list.Contains(material)) { list.Add(material); } } } targetMats.Add(list); } initialized = true; }