public override TaskStatus OnUpdate() { #if UNITY_EDITOR var m = UnityEditor.Editor.FindObjectOfType <ItemManager>(); generator.SetItems(m.items); #else generator.SetItems(ItemManager.instance.items); #endif generator.Generate(minAmount.Value, maxAmount.Value); return(TaskStatus.Success); }
public override void Awake() { base.Awake(); generator = new BasicItemGenerator(); #if UNITY_EDITOR var m = Editor.FindObjectOfType<ItemManager>(); generator.SetItems(m.items); #else generator.SetItems(ItemManager.instance.items); #endif generator.Generate(minAmount.Value, maxAmount.Value); }
public override void Awake() { base.Awake(); generator = new BasicItemGenerator(); #if UNITY_EDITOR var m = Editor.FindObjectOfType <ItemManager>(); generator.SetItems(m.items); #else generator.SetItems(ItemManager.instance.items); #endif generator.Generate(minAmount.Value, maxAmount.Value); }
public override BlockReturn Run(BlockReturn param) { generator = new BasicItemGenerator(); #if UNITY_EDITOR var m = Editor.FindObjectOfType <ItemManager>(); generator.SetItems(m.items); #else generator.SetItems(ItemManager.instance.items); #endif this.items = generator.Generate(minAmount.value, maxAmount.value); return(BlockReturn.OK); }
public override TaskStatus OnUpdate() { generator.SetItems(ItemManager.database.items); generator.Generate(minAmount.Value, maxAmount.Value); return(TaskStatus.Success); }
public override void Awake() { base.Awake(); generator = new BasicItemGenerator(); generator.SetItems(ItemManager.database.items); var itemsTemp = generator.Generate(minAmount.Value, maxAmount.Value); items.objectReferences = itemsTemp; }
protected void Awake() { container = GetComponent <IInventoryItemContainer>(); generator = new FilterGroupsItemGenerator(filterGroups); generator.SetItems(ItemManager.database.items); if (generateAtGameStart) { container.items = generator.Generate(minAmountTotal, maxAmountTotal, true); // Create instances is required to get stack size to work (Can't change stacksize on prefab) foreach (var item in container.items) { item.transform.SetParent(transform); } } }
protected virtual InventoryItemBase[] GenerateItems() { canGenerateItems = false; generator = new FilterGroupsItemGenerator(filterGroups); generator.SetItems(ItemManager.database.items); var items = generator.Generate(minAmountTotal, maxAmountTotal, true); // Create instances is required to get stack size to work (Can't change stacksize on prefab) foreach (var item in items) { item.transform.SetParent(transform); item.gameObject.SetActive(false); } return(items); }