示例#1
0
    private void OnNewStack(OSTData.ResourceStack stack)
    {
        ResourceIcon obj = Instantiate <ResourceIcon>(iconPrefab);

        obj.transform.SetParent(iconZone.transform);
        obj.SetData(stack);
    }
示例#2
0
    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);
        }
    }