Example #1
0
    void OnLevelWasLoaded(int mapIndex)
    {
        //		Debug.Log(strTest);

        if(mapIndex == (int)Definition.eSceneID.MatchRoomScene) {

            this.drawState = MatchController.DrawState.ENTER;
            isDraw = true;

            switch(currentLanguage) {
                case Definition.eLanguage.ENGLISH:
        //					Debug.Log("OnLevelWasLoaded:Definition.eLanguage.ENGLISH");
                    this.matchRoomSkin = Resources.Load("Skin/RoomEnglishLanguage", typeof(GUISkin)) as GUISkin;
                    break;

                case Definition.eLanguage.SIMPLECHINESE:
        //					Debug.Log("OnLevelWasLoaded:Definition.eLanguage.SIMPLECHINESE");
                    this.matchRoomSkin = Resources.Load("Skin/RoomSimpleChineseLanguage",  typeof(GUISkin)) as GUISkin;
                    break;

                case Definition.eLanguage.TRANDITIONALCHIINESE:
        //					Debug.Log("OnLevelWasLoaded:Definition.eLanguage.TRANDITIONALCHIINESE");
                    this.matchRoomSkin = Resources.Load("Skin/RoomTranditionalChineseLanguage",  typeof(GUISkin)) as GUISkin;
                    break;
            }

            matchRoomSceneViewer = GameObject.FindObjectOfType(typeof(MatchRoomSceneViewer)) as MatchRoomSceneViewer;
            lobbySceneViewer = GameObject.FindObjectOfType(typeof(LobbySceneViewer)) as LobbySceneViewer;

            LoadCarListStart();
            enabled = true;

            if(PlayerPrefs.GetString("GameType") == "Network") {
                OnJoinedMatch();
            }

        }else{
            enabled = false;
            this.drawState = MatchController.DrawState.FREE;
            isDraw = false;
            this.matchRoomSkin = null;
        }

        //		Debug.Log("Match:OnLevelWasLoaded");
    }
Example #2
0
    void OnLevelWasLoaded(int mapIndex)
    {
        if(mapIndex == (int)Definition.eSceneID.LobbyScene) {
            isSelectingMap = false;
            isEnterPlayerBase = false;
            isLeavingLobby = false;
            //isPlayerDataLoaded = false;
            this.focusState = LobbyController.FocusState.LOBBY;
            this.drawState = LobbyController.DrawState.ENTER;
            isDraw = true;

            switch(currentLanguage) {
                case Definition.eLanguage.ENGLISH:
        //					Debug.Log("OnLevelWasLoaded:Definition.eLanguage.ENGLISH");
                    this.lobbySkin = Resources.Load("Skin/LobbyEnglishLanguage", typeof(GUISkin)) as GUISkin;
                    break;

                case Definition.eLanguage.SIMPLECHINESE:
        //					Debug.Log("OnLevelWasLoaded:Definition.eLanguage.SIMPLECHINESE");
                    this.lobbySkin = Resources.Load("Skin/LobbySimpleChineseLanguage",  typeof(GUISkin)) as GUISkin;
                    break;

                case Definition.eLanguage.TRANDITIONALCHIINESE:
        //					Debug.Log("OnLevelWasLoaded:Definition.eLanguage.TRANDITIONALCHIINESE");
                    this.lobbySkin = Resources.Load("Skin/LobbyTranditionalChineseLanguage",  typeof(GUISkin)) as GUISkin;
                    break;
            }

            lobbySceneViewer = GameObject.FindObjectOfType(typeof(LobbySceneViewer)) as LobbySceneViewer;

            networkView.RPC("SendToGameLobby_LoadChatRoomPlayer", RPCMode.Server, lobbyRoom.roomIndex, this.playerInfo.GUPID);
            enabled = true;

            OnEnteredLobby();
        }else{

            this.focusState = LobbyController.FocusState.LOBBY;
            this.drawState = LobbyController.DrawState.FREE;
            isDraw = false;
            this.lobbySkin = null;
        //			Resources.UnloadAsset(this.lobbySkin);

            enabled = false;
        }

        if(mapIndex == (int)Definition.eSceneID.MapScene){

            if(OnSelectingMap != null) {
                OnSelectingMap();
            }

        }

        //Debug.Log("Lobby:OnLevelWasLoaded");
    }