Esempio n. 1
0
    /// <summary>
    /// Called after disconnecting from the Photon server.
    /// </summary>
    /// <remarks>In some cases, other callbacks are called before OnDisconnectedFromPhoton is called.
    /// Examples: OnConnectionFail() and OnFailedToConnectToPhoton().</remarks>
    public override void OnDisconnectedFromPhoton()
    {
//		print ("disconnected");
        base.OnDisconnectedFromPhoton();
        Cursor.lockState = CursorLockMode.None;
        StartCoroutine(CoroutineHelper.IELoadAsyncScene(RoomLevelHelper.GetSceneName(RoomLevelHelper.SCENE.MAIN_MENU)));
    }
Esempio n. 2
0
    public void StartSinglePlayer(/*RoomLevelHelper.SCENE scene*/)
    {
//		if (!_startSceneLocked) {
//			StartCoroutine (CoroutineHelper.IELoadAsyncScene (sceneName));
//			_startSceneLocked = true;
//		}
        if (!_startSceneLocked)
        {
            PhotonNetwork.Disconnect();
            PhotonNetwork.offlineMode = true;
            MainMenuController.MMC.StartScene(RoomLevelHelper.GetSceneName(RoomLevelHelper.SCENE.PRISON /*scene*/));
            _startSceneLocked = true;
        }
    }
Esempio n. 3
0
    //dev controlls
    void Update()
    {
                #if UNITY_EDITOR
        if (PhotonNetwork.isMasterClient)
        {
            if (Input.GetKeyUp(KeyCode.P))
            {
                if (AIController.AIC.GetIsAIMovementAllowed())
                {
                    AIController.AIC.SetIsAIMovementAllowed(false);
                }
                else
                {
                    AIController.AIC.SetIsAIMovementAllowed(true);
                }
            }
        }
        if (GameController.GC.CurrentPlayerCharacter == null)
        {
            if (GameController.GC.IsGameOver)
            {
                if (Input.GetKeyUp(KeyCode.Q))
                {
                    Cursor.lockState = CursorLockMode.None;
                    StartCoroutine(CoroutineHelper.IELoadAsyncScene(RoomLevelHelper.GetSceneName(RoomLevelHelper.SCENE.SURVEY)));
                }
            }
            else
            {
//				if (Input.GetKeyUp (KeyCode.R)) {
//					UIController.SINGLETON.SetDevText ("");
//					NetworkManager.SINGLETON.spawnPlayer ();
//
//					if (RoomLevelHelper.ROOMTYPE == ROOM_TYPE.COOP) {
//						GameController.GC.SetLives (GameController.GC.Lives - 1);
//					} else {
////						if (RoomLevelHelper.PLAYER_TEAM == TEAM.ONE) {
////							PvpManager.SINGLETON.SetTeamLife (PvpManager.SINGLETON.Team_1_Life - 1, PvpManager.SINGLETON.Team_2_Life);
////						} else if (RoomLevelHelper.PLAYER_TEAM == TEAM.TWO) {
////							PvpManager.SINGLETON.SetTeamLife (PvpManager.SINGLETON.Team_1_Life, PvpManager.SINGLETON.Team_2_Life - 1);
////						}
//					}
//				}
            }
        }
                #endif
    }
Esempio n. 4
0
    /// <summary>
    /// Loads the scene which is determined by when creating or joining existing room
    /// </summary>
    public void LoadScene()
    {
//		RoomLevelHelper.SCENE currentLevel = (RoomLevelHelper.SCENE)RoomLevelHelper.ROOM_INFO.customProperties [RoomLevelHelper.CUSTOM_ROOM_PROPERTY_CURRENT_SCENE];
        RoomLevelHelper.SCENE currentLevel = RoomLevelHelper.CURRENT_SCENE;
        MainMenuController.MMC.StartScene(RoomLevelHelper.GetSceneName(currentLevel));
    }