Beispiel #1
0
    void Start()
    {
        mLevelManager = gameObject.GetComponent<LevelManager>();
        mTowerManager = gameObject.GetComponent<TowerManager>();

        mTowerIconsList = new List<GameObject>();

        for (int i = 0; i < towerIconList.Count; i++)
            mTowerIconsList.Add(Instantiate(towerIconList[i]) as GameObject);

        mCloseButton = Instantiate(closeButton) as GameObject;
        mCloseButton.active = false;
        mBuyButton = Instantiate(buyButton) as GameObject;
        mBuyButton.active = false;
        mSellButton = Instantiate(sellButton) as GameObject;
        mSellButton.active = false;
        mUpgradeButton = Instantiate(upgradeButton) as GameObject;
        mUpgradeButton.active = false;

        mUpgradeMenuActive = false;

        mType = GameObject.Instantiate(type) as GameObject;
        mType.GetComponent<TextMesh>().text = " ";

        mCurrent = GameObject.Instantiate(current) as GameObject;
        mCurrent.GetComponent<TextMesh>().text = " ";

        mUpgrade = GameObject.Instantiate(upgrade) as GameObject;
        mUpgrade.GetComponent<TextMesh>().text = " ";

        mUpgradeValue = GameObject.Instantiate(upgradeValue) as GameObject;
        mUpgradeValue.GetComponent<TextMesh>().text = " ";

        mSellValue = GameObject.Instantiate(sellValue) as GameObject;
        mSellValue.GetComponent<TextMesh>().text = " ";

        mTextRight = GameObject.Instantiate(textRight) as GameObject;
        mTextRight.GetComponent<TextMesh>().text = " ";

        mCurrentIcon = null;
        mCurrentUpgradeIcon = null;

        mTextRight.GetComponent<TextMesh>().text =
            "Level:" + mLevelManager.GetLevelNumber() +
            "\nBank:" + mLevelManager.GetBank();
    }