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; }
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; }