private void OnNewStack(OSTData.ResourceStack stack) { ResourceIcon obj = Instantiate <ResourceIcon>(iconPrefab); obj.transform.SetParent(iconZone.transform); obj.SetData(stack); }
public void SetZone(OSTData.ResourceHolder zone) { _zone = zone; zone.onNewStack += OnNewStack; zone.onRemoveStack += OnRemoveStack; foreach (OSTData.ResourceStack s in zone.ResourceStacks) { ResourceIcon obj = Instantiate <ResourceIcon>(iconPrefab); obj.transform.SetParent(iconZone.transform); obj.SetData(s); } }