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(); }
/// <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(); } }
// used for ui buttons to load a game scene public void HostSelectGame(int index) { if (!PhotonNetwork.IsMasterClient) { return; } PlayerPrefs.SetInt("game", index); hostSelectGameEvent.Raise(); }