Exemplo n.º 1
0
    private void Update()
    {
        if (Input.GetKeyDown(joinKey))
        {
            joinEvent.Raise();
        }
        if (OVRInput.Get(joinButton))
        {
            joinEvent.Raise();
        }

        if (Input.GetKeyDown(leaveKey))
        {
            leaveEvent.Raise();
        }
        if (OVRInput.Get(leaveButton))
        {
            leaveEvent.Raise();
        }

        //if (Input.GetKeyDown(loadGameKey)) loadGameEvent.Raise();
        //if (OVRInput.Get(loadGameButton)) loadGameEvent.Raise();

        //if (Input.GetKeyDown(unloadGameKey)) unloadGameEvent.Raise();
        //if (OVRInput.Get(unloadGameButton)) unloadGameEvent.Raise();
    }
Exemplo n.º 2
0
 /// <summary>
 /// Called when any player leaves photon room.
 /// </summary>
 public override void OnPlayerLeftRoom(Player otherPlayer)
 {
     // if the host leaves raise an event
     if (host != null && otherPlayer == host)
     {
         onHostDisconnectEvent.Raise();
     }
 }
Exemplo n.º 3
0
 // used for ui buttons to load a game scene
 public void HostSelectGame(int index)
 {
     if (!PhotonNetwork.IsMasterClient)
     {
         return;
     }
     PlayerPrefs.SetInt("game", index);
     hostSelectGameEvent.Raise();
 }