SceneNameMenu









How do I use Scene Name Menu
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: WorkerInGame.cs Copy
13     public void Awake()
14     {
15         // in case we started this demo with the wrong scene being active, simply load the menu scene
16         if (!PhotonNetwork.connected)
17         {
18             Application.LoadLevel(WorkerMenu.SceneNameMenu);
19             return;
20         }
21
22         // we're in a room. spawn a character for the local player. it gets synced by using PhotonNetwork.Instantiate
23         PhotonNetwork.Instantiate(this.playerPrefab.name, transform.position, Quaternion.identity, 0);
24     }
File name: WorkerInGame.cs Copy
58     public void OnLeftRoom()
59     {
60         Debug.Log("OnLeftRoom (local)");
61
62         // back to main menu
63         Application.LoadLevel(WorkerMenu.SceneNameMenu);
64     }
File name: WorkerInGame.cs Copy
66     public void OnDisconnectedFromPhoton()
67     {
68         Debug.Log("OnDisconnectedFromPhoton");
69
70         // back to main menu
71         Application.LoadLevel(WorkerMenu.SceneNameMenu);
72     }
File name: WorkerInGame.cs Copy
89     public void OnFailedToConnectToPhoton()
90     {
91         Debug.Log("OnFailedToConnectToPhoton");
92
93         // back to main menu
94         Application.LoadLevel(WorkerMenu.SceneNameMenu);
95     }

SceneNameMenu 126 lượt xem

Gõ tìm kiếm nhanh...