Advertisement
Guest User

Stribog10 Waiting for Connection

a guest
Aug 14th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1.  
  2.         /* *
  3.          * <summary>
  4.          * Periodically checks if a 2nd player has joined, if the user is waiting and if the model UI has been instantiated.
  5.          * If all these conditions are met, the UI shifts accordingly.
  6.          * </summary>
  7.          * */
  8.         if (PhotonNetwork.playerList.Length > 1 && !modelUI.gameObject.activeSelf && waitingUI.gameObject.activeSelf) {
  9.             waitingUI.gameObject.SetActive (false);
  10.             modelUI.gameObject.SetActive (true);
  11.         }
  12.         /* *
  13.          * <summary>
  14.          * If user disconnects during character selection, reverts to waiting menu state.
  15.          * In the future, this will work after a character has been selected as well.
  16.          * </summary>
  17.          * */
  18.         if (PhotonNetwork.playerList.Length == 1 && modelUI.gameObject.activeSelf && !waitingUI.gameObject.activeSelf) {
  19.             modelUI.gameObject.SetActive (false);
  20.             waitingUI.gameObject.SetActive (true);
  21.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement