public void Set(StockPileSetting sps) { this.stockPileSetting = sps; this.item = sps.item; itemDisplayName = item.niceName; itemName = this.item.type; intValue = sps.maxQty; stringValue = intValue.ToString(); looseSetting = World.current.inventoryManager.looseQtys[sps.name]; Init(); }
public void CreateStockpileManagement() { foreach (string name in World.current.inventoryManager.stockpileSettings.Keys) { StockPileSetting sps = World.current.inventoryManager.stockpileSettings[name]; GameObject go = SimplePool.Spawn(prfStockpileManagementEntry, Vector2.zero, Quaternion.identity); prfStockPileItemScript scr = go.GetComponent <prfStockPileItemScript>(); scr.Set(sps); scr.SetCurrentQty(0); go.transform.SetParent(this.StockPileScrollContent.transform); go.transform.localScale = Vector3.one; StockPileSettings_GO_Map[sps.name] = go; } }