Esempio n. 1
0
    public void SetPanel()
    {
        Dictionary <int, int> res_counts = StorageManager.GetUserResources();

        res_cells = new Dictionary <int, ResourceCell>();
        foreach (var key in res_counts.Keys)
        {
            var          count    = res_counts[key];
            ResourceCell resource = Instantiate(res_cell);
            resource.gameObject.SetActive(true);
            resource.SetData(StorageManager.GetResource(key), count);
            resource.transform.SetParent(group.transform);
            resource.transform.localScale = new Vector3(1, 1, 1);
            res_cells[key] = resource;
        }
    }
Esempio n. 2
0
    public void SetItem(Item item)
    {
        text.text      = item.GetName();
        image.material = item.GetMaterial();
        this.item      = item;

        res_counts = StoreManager.GetItemPrice(item.GetID());
        CheckValidation();

        foreach (var key in res_counts.Keys)
        {
            var          count    = res_counts[key];
            ResourceCell resource = Instantiate(res_cell);
            resource.gameObject.SetActive(true);
            resource.SetData(StorageManager.GetResource(key), count);
            resource.transform.SetParent(group.transform);
            resource.transform.localScale = new Vector3(1, 1, 1);
        }
    }