public IEnumerator Initialize() { //galbis = XMLManager<XMLGalbi, Galbi>.Load (gameObject, "Galbi.xml"); ingredients = XMLManager <XMLIngredient> .Load(ResourcePath.xmlIngredient); ResourcesManager resourceManager = ResourcesManager.getInstance; List <XMLIngredient> .Enumerator eIngredient = ingredients.GetEnumerator(); while (eIngredient.MoveNext()) { XMLIngredient ingredient = eIngredient.Current; List <string> paths = new List <string>(); paths.Add(ingredient.GetResourcePath(ingredient.type)); if (ingredient.type == EIngredientType.Galbi) { paths.Add(ingredient.GetGalbiPath(1, false)); paths.Add(ingredient.GetGalbiPath(2, false)); paths.Add(ingredient.GetGalbiPath(3, false)); paths.Add(ingredient.GetGalbiPath(4, false)); paths.Add(ingredient.GetGalbiPath(5, false)); paths.Add(ingredient.GetGalbiPath(6, false)); paths.Add(ingredient.GetGalbiPath(7, false)); paths.Add(ingredient.GetFailGalbiPath(false)); paths.Add(ingredient.GetSaucePath(false)); paths.Add(ingredient.GetPowderPath(false)); } if (ingredient.type == EIngredientType.Deco) { paths.Add(string.Format("{0}/{1}_icon", ResourcePath.decoObject, ingredient.name)); } List <string> .Enumerator path = paths.GetEnumerator(); while (path.MoveNext()) { string resourcePath = path.Current; resourceManager.LoadResource(RESOURCE_TYPE.TEXTURE, resourcePath); } } yield return(null); }
public XMLIngredient GetIngredient(EIngredientType type, int id) { if (ingredients == null) { //Initialize(); } List <XMLIngredient> .Enumerator eIngredient = ingredients.GetEnumerator(); while (eIngredient.MoveNext()) { XMLIngredient ingredient = eIngredient.Current; if (ingredient.type.Equals(type) && ingredient.id.Equals(id)) { return(ingredient); } } throw new Exception("Invalid Galbi as ID"); }
public void SetIngredient(XMLIngredient ingredient) { SetIngredient(ingredient.type, ingredient.id, ingredient.name, ingredient.price); }