public static AvailablePart getPartForExperiment(string type, ExperimentData exp) { AvailablePart ap = null; string[] partsRegistry = null; switch (type) { case OMS_EXPERIMENTS: partsRegistry = omsRegistry; break; case KEMINI_EXPERIMENTS: partsRegistry = getKeminiRegister(); break; } for (int idx = 0, count = partsRegistry.Length; idx < count; idx++) { ap = PartLoader.getPartInfoByName(partsRegistry[idx]); if (ap != null) { NE_ExperimentModule e = ap.partPrefab.GetComponent <NE_ExperimentModule>(); if (e.type == exp.getType()) { break; } } } return(ap); }
internal GameDatabase.TextureInfo getTextureForExperiment(ExperimentData expData) { GameDatabase.TextureInfo tex; if (textureReg.TryGetValue(expData.getType(), out tex)) { return(tex); } else { NE_Helper.log("Loading Texture for experiment: " + expData.getType()); GameDatabase.TextureInfo newTex = getTexture(expData.getType()); if (newTex != null) { textureReg.Add(expData.getType(), newTex); return(newTex); } } return(null); }