public static bool CreateItemStart(out Item item, string givenID) { item = (Item)System.Activator.CreateInstance(LootManager.completeItemDict[givenID].GetType()); if (givenID.StartsWith("Lizard.Mod_")) { item.ID = Lizard.GetID(item); IModItem modItem = (IModItem)item; modItem.Init(); } return(true); }
internal static void AddModItem(Item item, UnityEngine.Sprite sprite) { IModItem modItem = (IModItem)item; object itemInfo = CreateItemInfo(); ItemLink.id.SetValue(itemInfo, item.ID); ItemLink.displayName.SetValue(itemInfo, modItem.DisplayName); ItemLink.description.SetValue(itemInfo, modItem.Description); ModItems.Add(item.ID, modItem); ModItemImages.Add(item.ID, sprite); ModItemDescriptions.Add(item.ID, itemInfo); LootManager.completeItemDict.Add(item.ID, item); }
private static Sprite LoadItemSprite(Item item) { IModItem modItem = (IModItem)item; return(LoadObjectSprite(item, item.ID, "Item", modItem.ItemImage)); }