UsableItem CreateDataListEntryItem(SourceDataItemSO source, ItemFactoryData template) { ITEMTYPE type = source.type; UsableItem tmp; switch (type) { case ITEMTYPE.FOOD: tmp = new ConsumableItem(template, source); //tmp.SetTarget(owner); return(tmp); // break; case ITEMTYPE.CLEANING_MATERIAL: tmp = new ConsumableItem(template, source); //tmp.SetTarget(owner); return(tmp); case ITEMTYPE.PROTECTIVE_EQUIPMENT: tmp = new EquipmentItem(template, source); //tmp.SetTarget(owner); return(tmp); // break; } Debug.LogError("type not found, please check: " + template.ItemName); return(null); }
public EquipmentItem(ItemFactoryData template, SourceDataItemSO source) { // Debug.Log("equipment cerated"); base.Initialize(template); base.SetSource(source); }
public ConsumableItem(ItemFactoryData template, SourceDataItemSO source) { // Debug.Log("consummable created"); base.Initialize(template); base.SetSource(source); }