private static void AddDefinition(Item item, ItemDefinitions definitions) { var definition = new ItemRecord { ID = item.ID, Name = item.Name, ParentID = item.ParentID, TemplateID = item.TemplateID, }; definitions.Add(item.ID, definition); }
private void LoadSingleItemPrefab(string name, ItemTypes type, string prefabName) { GameObject go = Resources.Load(PrefabsFolderPath + prefabName) as GameObject; var itemDefinition = new ItemDefinition( name, type, go ); itemDefinition.Sprite = go.GetComponent <SpriteRenderer>().sprite; ItemDefinitions.Add(type, itemDefinition); }