Exemplo n.º 1
0
    public void OnEnable()
    {
        SMSP = gameObject.GetComponent <SellMineralSubPanel>();
        sellMinerals.Clear();
        costMinerals.Clear();

        lengStorage = ConstGameCtrl.instance.playerStorage.Count;
        if (lengStorage > 0)
        {
            canSell     = true;
            currMinSell = 0;

            foreach (KeyValuePair <string, int> keyValue in ConstGameCtrl.instance.playerStorage)
            {
                sellMinerals.Add(keyValue.Key);
                costMinerals.Add(ConstGameCtrl.instance.allPrizes.Find(x => x.prizeName == keyValue.Key).prizeCost);
            }

            // Рисуем картинки минералов в окошке
            DisplayStorageContent();
        }
    }
Exemplo n.º 2
0
 // Start is called before the first frame update
 void Awake() // Может и не сработать
 {
     SMSP = gameObject.GetComponent <SellMineralSubPanel>();
     GSM  = gameObject.GetComponent <GeneralSubMenu>();
 }