Ejemplo n.º 1
0
    public void OnSelectClick(MarketElement currentMarketElement)
    {
        if (currentMarketElement.IsOpen())
        {
            SelectCurrentElement(currentMarketElement);
        }
        else
        {
            if (library.money.GetMoney() >= GameplayConstants.PurchasePrice /*если хватает бабосов, то открываем, выбирраем, снимаем бабосы*/)
            {
                PreferencesSaver.SetOpenElementInMarket(currentMarketElement.num);
                currentMarketElement.Open();
                SelectCurrentElement(currentMarketElement);
                library.money.AddMoney(-GameplayConstants.PurchasePrice);
                library.money.SaveMoney();
            }
        }
//            library.screenController.HideMarketScreen();
    }
Ejemplo n.º 2
0
    public void SelectCurrentElement(MarketElement currentMarketElement)
    {
        if (currentMarketElement.IsOpen())
        {
            foreach (MarketElement marketElement in marketElements)
            {
                marketElement.SetNotCurrent();
            }


            currentMarketElement.SetCurrent();

            for (int i = 0; i < marketElements.Length; i++)
            {
                if (marketElements[i].Equals(currentMarketElement))
                {
                    PreferencesSaver.SetCurrentElementInMarket(i);
                    break;
                }
            }
        }
    }