Exemplo n.º 1
0
    void OnDestroy()
    {
        instance = null;

        uiInGame         = null;
        uiTowerPlacement = null;
        uiTowerBuy       = null;
        uiPathArray      = null;
        uiMessageBox     = null;
        uiWaiting        = null;

        rootPanelArray = null;
        gameStatus     = null;

        enemyList = null;

        startPointArray = null;
        endPointArray   = null;
    }
Exemplo n.º 2
0
    private void LoadUICompleteCB(GameObject gameObj, System.Guid uid, params object[] param)
    {
        if (gameObj != null)
        {
            GameObject createObj = Instantiate(gameObj) as GameObject;

            createObj.transform.parent        = rootPanelArray[(int)eRootPanelType.Type_Root].transform;
            createObj.transform.localPosition = Vector3.zero;
            createObj.transform.localScale    = gameObj.transform.localScale;

            switch ((eUIType)param[0])
            {
            case eUIType.Type_InGame:
                uiInGame = createObj.GetComponent <UIInGame>();
                break;

            case eUIType.Type_TowerBuy:
                uiTowerBuy = createObj.GetComponent <UITowerBuy>();
                break;

            case eUIType.Type_TowerPlacement:
                uiTowerPlacement = createObj.GetComponent <UITowerPlacement>();
                break;

            case eUIType.Type_MessageBox:
                uiMessageBox = createObj.GetComponent <UIMessageBox>();
                break;

            case eUIType.Type_GameResult:
                uiGameResult = createObj.GetComponent <UIGameResult>();
                break;

            case eUIType.Type_Waiting:
                uiWaiting = createObj.GetComponent <UIWaiting>();
                break;
            }
        }
    }