Exemple #1
0
    private void init()
    {
        m_cStageMgr = new C_STAGEMGR();
        m_cPlayer   = GameObject.Find("Player").GetComponent <C_PLAYER>();

        m_QternCameraRotate = Camera.main.transform.rotation;
        m_goLoadData        = GameObject.Find("LoadData");
        m_cLoadData         = m_goLoadData.GetComponent <C_LOADDATA>();

        m_cGameCoin = m_cPlayer.gameObject.GetComponent <C_GAMECOIN>();


        m_cPlayer.init(PlayerPrefs.GetInt("StartResource"), 0, 30);


        Debug.Log(PlayerPrefs.GetInt("coinPrice") + "   " + PlayerPrefs.GetInt("StartResource") + "    " + PlayerPrefs.GetFloat("difficultyHp"));

        m_cStageMgr.init(m_goMovingPoint, m_goPosibleTile, m_goImposibleTile, m_cPlayer, m_cLoadData.getLoadNode(), PlayerPrefs.GetFloat("difficultyHp"));

        m_cGameCoin.init(PlayerPrefs.GetInt("coinPrice"));
        m_cGameCoin.FlututionCoin((m_cStageMgr.getEnemyWave().GetComponent <C_ENEMYWAVE>().getStageCount() + 1));


        m_cUi = new C_UI();
        m_cUi.init();
        //m_cUi.UpdateUi(m_cPlayer, m_cGameCoin,m_cInput);

        m_cStageMgr.getEnemyWave().GetComponent <C_ENEMYWAVE>().setPlayer(m_cPlayer);
        m_cStageMgr.getEnemyWave().GetComponent <C_ENEMYWAVE>().setDifficultyHp(PlayerPrefs.GetFloat("difficultyHp"));
        C_TOWERINFO.m_fUpgradeCount = 0;

        m_goMapHolder        = GameObject.Find("MarsMaps");
        m_goTowerHolder      = new GameObject();
        m_goTowerHolder.name = "TowerHolder";
        m_goTowerHolder.transform.position = new Vector3(11.0f, 0.0f, 11.0f);
        m_cInput = GameObject.Find("UIEvent").GetComponent <C_INPUT>();
        m_cInput.load(m_cPlayer, m_cGameCoin, m_cStageMgr.getEnemyWave().GetComponent <C_ENEMYWAVE>(), m_goTowerHolder);
        //m_cMyTowerProc = GameObject.Find("TowerCreater").GetComponent<C_MYTOWERPROC>();
        m_cMyTowerProc = new C_MYTOWERPROC();
        m_cMyTowerProc.init();

        m_cSceneMgr = gameObject.GetComponent <C_SCENEMGR>();


        m_cGameOver     = GameObject.Find("MainUiCanvas").transform.GetChild(5).GetComponent <C_GAMEOVER>();
        m_goQuestionBox = GameObject.Find("QuestionCanvas");
        m_goQuestionBox.GetComponent <C_QUESTIONMESSAGEBOX>().CloseQuestionBox();

        m_goEnemyHolder       = GameObject.Find("EnemyHolder");
        m_goMovingPointHolder = GameObject.Find("MovingPoints");
    }
Exemple #2
0
        void Start()
        {
            m_cMyTowerProc = new C_MYTOWERPROC();
            m_cLoadData    = GameObject.Find("LoadData").GetComponent <C_LOADDATA>();
            m_cMyTowerProc.init();

            playerManager = GameObject.Find("PlayerManager");

            gameObject.GetComponent <C_MAPEDITMR>().setBool(playerManager.GetComponent <ProductManager>().towers.Count);

            m_tgTest = new Toggle[playerManager.GetComponent <ProductManager>().towers.Count];


            settingView();
            gr  = GameObject.Find("MainCanvas").GetComponent <GraphicRaycaster>();
            ped = new PointerEventData(null);
        }