LoadLevel() public static method

Loads the level and automatically pauses the network queue. Call this in OnJoinedRoom to make sure no cached RPCs are fired in the wrong scene.
public static LoadLevel ( int levelNumber ) : void
levelNumber int /// Number of the level to load (make sure it's in the build preferences). ///
return void
Ejemplo n.º 1
0
 private void OnJoinedRoom()
 {
     PhotonNetwork.LoadLevel("Sc");
 }
Ejemplo n.º 2
0
    public override void OnJoinedRoom()
    {
        Debug.Log("PUN BotS/Lobby: OnJoinedRoom() called by PUN. Now this client is in a room.");

        PhotonNetwork.LoadLevel("Battle Scene");
    }
Ejemplo n.º 3
0
 //如果玩家断开与Photon服务器的连接,加载场景GameLobby
 public override void OnConnectionFail(DisconnectCause cause)
 {
     PhotonNetwork.LoadLevel("LobbyScene");
 }
Ejemplo n.º 4
0
 private void Start()
 {
     PhotonNetwork.LoadLevel(1);
 }
Ejemplo n.º 5
0
 public void CreateGame()
 {
     PhotonNetwork.LoadLevel(1);
 }
Ejemplo n.º 6
0
 public void LoadLevel()
 {
     PhotonNetwork.LoadLevel((int)roomProperties["map"]);
 }
Ejemplo n.º 7
0
 public void StartGame()
 {
     PhotonNetwork.LoadLevel(1);
 }
Ejemplo n.º 8
0
 public override void OnLeftRoom()
 {
     PhotonNetwork.LoadLevel(0);
 }
Ejemplo n.º 9
0
 // Cuando ha terminado de salir carga el menú principal.
 public override void OnLeftRoom()
 {
     base.OnLeftRoom();
     PhotonNetwork.LoadLevel("MainMenu");
 }
Ejemplo n.º 10
0
 public void OnClickLeaveMatch()
 {
     PhotonNetwork.LeaveRoom();
     PhotonNetwork.LoadLevel(1);
 }
Ejemplo n.º 11
0
 //Multiplayer override
 public override void OnJoinedRoom()
 {
     PhotonNetwork.LoadLevel("OnlineGame");
 }
Ejemplo n.º 12
0
 public void button5()
 {
     PhotonNetwork.JoinRoom(roomscurrent[4 + (roomlistcount * 5)].Name); PhotonNetwork.LoadLevel(1); Loading.SetActive(true);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Allows the player to join a selected room.
 /// </summary>
 public void JoinRoom()
 {
     PhotonNetwork.JoinRoom(roomscurrent[gamescount].Name);
     Loading.SetActive(true);
     PhotonNetwork.LoadLevel(1);
 }
Ejemplo n.º 14
0
    // 카운트다운
    IEnumerator CountDown()
    {
        isPrepare = true;
        msg.text  = "게임이 곧 시작됩니다";
        countNum.gameObject.SetActive(false);

        yield return(new WaitForSeconds(0.5f));

        countDown.gameObject.SetActive(true);
        countDown.text = ((int)time).ToString();

        yield return(new WaitForSeconds(1));

        while ((true) && (SceneManager.GetActiveScene().name.Equals("Room Scene")))
        {
            countDown.text = ((int)time).ToString();

            if (PhotonNetwork.IsMasterClient)
            {
                // 1초
                time -= Time.deltaTime;

                while (bossActorNum == -1)
                {
                    findPlayer();

                    bossnum = Random.Range(0, PhotonNetwork.PlayerList.Length);             // 번호 랜덤 선택

                    temp = PhotonNetwork.PlayerList[bossnum].CustomProperties;

                    // bossnum 접근 편하게 index에서 ActorNum으로 변경
                    playerPos[(int)temp["index"]].z -= 1;  // 깜박임 방지
                    PhotonNetwork.Instantiate("BossPrefab", playerPos[(int)temp["index"]], Quaternion.identity, 0);

                    bossActorNum = (int)temp["ActorNum"];
                    pv.RPC("setBoss", RpcTarget.All, bossActorNum);
                }

                cnt = 0;
                for (int i = 0; i < PhotonNetwork.PlayerList.Length; i++)
                {
                    temp = PhotonNetwork.PlayerList[i].CustomProperties;

                    if (temp.ContainsKey("Ready"))
                    {
                        if (((string)temp["Ready"]).Equals("Yes"))
                        {
                            cnt++;
                        }
                    }
                }

                // 카운트다운 후 게임 씬 이동
                if (time < 0)
                {
                    PhotonNetwork.CurrentRoom.IsOpen    = false;
                    PhotonNetwork.CurrentRoom.IsVisible = false;
                    pv.RPC("loadRoomManager", RpcTarget.All);
                    cnt = 0;

                    if (PhotonNetwork.IsMasterClient)
                    {
                        PhotonNetwork.Destroy(GameObject.Find("BossPrefab(Clone)"));
                        playerPos[(int)temp["index"]].z += 1;
                    }
                    PhotonNetwork.LoadLevel("Game Scene");
                    SceneManager.LoadScene("Game Scene");
                    yield break;
                }
            }

            // 카운트다운 시작 후 Ready 해제하여 Ready한 플레이어가 3명 미만일 때 실행
            if (SceneManager.GetActiveScene().name.Equals("Room Scene") && (cnt < readyCnt))
            {
                isPrepare     = false;
                msg.text      = "다른 유저를 대기중입니다";
                countNum.text = PhotonNetwork.PlayerList.Length.ToString() + "/5";
                bossActorNum  = -1;

                if (PhotonNetwork.IsMasterClient)
                {
                    PhotonNetwork.Destroy(GameObject.Find("BossPrefab(Clone)"));
                    pv.RPC("setBoss", RpcTarget.All, -1);
                }
                pv.RPC("clearCheckBoss", RpcTarget.All);
                countNum.gameObject.SetActive(true);
                countDown.gameObject.SetActive(false);
                yield break;
            }

            yield return(null);
        }
    }
Ejemplo n.º 15
0
 public override void OnCreatedRoom()
 {
     //battleシーンへ遷移
     PhotonNetwork.IsMessageQueueRunning = false;
     PhotonNetwork.LoadLevel(BOARD_SCENE_NAME);
 }
Ejemplo n.º 16
0
 public override void OnJoinedRoom()
 {
     //UnityEngine.Debug.Log("MENU OnJoinedRoom() called by PUN. Now this client is in a room.");
     PhotonNetwork.LoadLevel("Game");
 }
Ejemplo n.º 17
0
 public override void OnJoinedRoom()
 {
     PhotonNetwork.LoadLevel(1);
 }
Ejemplo n.º 18
0
    IEnumerator StopGame()
    {
        yield return(new WaitForSeconds(3));

        PhotonNetwork.LoadLevel(3);
    }
Ejemplo n.º 19
0
 private void LoadGameLevel()
 {
     PhotonNetwork.LoadLevel("Game");
 }
Ejemplo n.º 20
0
 private void LoadLevel(int id)
 {
     PhotonNetwork.LoadLevel(id);
 }
Ejemplo n.º 21
0
 void RPC_LoadGameOthers(string scene)
 {
     PhotonNetwork.LoadLevel(scene);
 }
Ejemplo n.º 22
0
 public void OnCreatedRoom()
 {
     Debug.Log("OnCreatedRoom");
     PhotonNetwork.LoadLevel(SceneNameGame);
 }
Ejemplo n.º 23
0
 private void RPC_LoadGameOthers()
 {
     PhotonNetwork.LoadLevel(2);
 }
Ejemplo n.º 24
0
 public override void OnJoinedRoom()
 {
     StopAllCoroutines();
     PhotonNetwork.LoadLevel("Main Game");
     Debug.Log(PhotonNetwork.CurrentRoom.Name);
 }
Ejemplo n.º 25
0
 public void ResetToMenu()
 {
     PhotonNetwork.LeaveRoom();
     PhotonNetwork.LoadLevel("MenuTest");
 }
Ejemplo n.º 26
0
 public void ToBattleMenu()
 {
     PhotonNetwork.LoadLevel("Lobby");
 }
Ejemplo n.º 27
0
 private void ObjectGrabbed(object sender, InteractableObjectEventArgs e)
 {
     PhotonNetwork.LeaveRoom();
     PhotonNetwork.LoadLevel(Lobby.name);
 }
Ejemplo n.º 28
0
 public void ChangeScene(string sceneName)
 {
     PhotonNetwork.LoadLevel(sceneName);
 }
Ejemplo n.º 29
0
 //离开房间函数
 public void LeaveRoom()
 {
     //mainCamera.enabled = true;
     PhotonNetwork.LeaveRoom();                      //玩家离开游戏房间
     PhotonNetwork.LoadLevel("LobbyScene");          //加载场景GameLobby
 }
    IEnumerator TwoPlayerInRoom()
    {
        yield return(new WaitForSeconds(2f));

        PhotonNetwork.LoadLevel("Battle");
    }