Esempio n. 1
0
    protected void Initialize()
    {
        Text[] objects = GetComponentsInChildren <Text>();
        foreach (Text obj in objects)
        {
            if (obj.name == "AssetsText")
            {
                assetsText = obj;
            }
            else if (obj.name == "ValuationText")
            {
                valuationText = obj;
            }
            else if (obj.name == "PriceText")
            {
                priceText = obj;
            }
            else if (obj.name == "LevelText")
            {
                levelText = obj;
            }
            else if (obj.name == "PercentageText")
            {
                percentageText = obj;
            }
            else if (obj.name == "MessageText")
            {
                messageText = obj;
            }
        }
        priceSystem = GetComponent <PriceSystem>();
        assets      = 0;
        Game.Instance.AddCurrency(this);

        assetsText.color    = myColor;
        valuationText.color = myColor;

        trader = GetComponentInChildren <TradePanel>();
        trader.SetCurrency(this);
    }