The main class to use the PhotonNetwork plugin. This class is static.
Пример #1
0
 void OnLeftRoom()
 {
     PhotonNetwork.LoadLevel("Lobby");
 }
Пример #2
0
 public override void OnConnectedToMaster()
 {
     Debug.Log("Connected to master");
     PhotonNetwork.JoinLobby();
     PhotonNetwork.AutomaticallySyncScene = true;
 }
Пример #3
0
 public void JoinLobby()
 {
     PhotonNetwork.JoinRoom("Test7");
 }
Пример #4
0
 void OnMasterClientSwitched(Player newMasterClient)
 {
     PhotonNetwork.LeaveRoom();
 }
Пример #5
0
 private void CreatePlayer()
 {
     PhotonNetwork.Instantiate(Path.Combine("PhotonPrefabs", "PhotonNetworkPlayerModel"), transform.position, Quaternion.identity, 0);
 }
Пример #6
0
 public void OnClickLeaveRoom()
 {
     MenuManager.Instance.ChangeCanvas(1);
     PhotonNetwork.LeaveRoom();
 }
Пример #7
0
 public override void OnConnectedToMaster()
 {
     Debug.Log("Connected to Master");
     PhotonNetwork.JoinLobby();
 }
Пример #8
0
 public override void OnEnable()
 {
     base.OnEnable();
     PhotonNetwork.AddCallbackTarget(this);
     SceneManager.sceneLoaded += OnSceneFinishedLoading;
 }
Пример #9
0
 public void CriaSala()
 {
     PhotonNetwork.JoinOrCreateRoom(nomeSala.text, new RoomOptions(), TypedLobby.Default);
 }
Пример #10
0
 public override void OnConnectedToMaster()
 {
     PhotonNetwork.JoinLobby();
     txtNick.text = PhotonNetwork.NickName;
 }
Пример #11
0
 public void LeaveRoom()
 {
     PhotonNetwork.LeaveRoom();
 }
Пример #12
0
 public override void SetTrap()
 {
     newMine  = PhotonNetwork.Instantiate(minePrefab.name, transform.position, Quaternion.identity);
     mineClas = newMine.GetComponent <Mine>();
     mineClas.SetTheTag(gameObject.tag);
 }
Пример #13
0
 public void LeaveLobby()
 {
     PhotonNetwork.LeaveRoom();
     MainMenu.Open();
 }
Пример #14
0
 public override void OnConnectedToMaster()
 {
     PhotonNetwork.JoinRandomRoom();
 }
Пример #15
0
 void OnClick()
 {
     Debug.Log(InputToEvent.inputHitPos);
     ga = PhotonNetwork.Instantiate(prefab.name, InputToEvent.inputHitPos, Quaternion.identity, 0);
 }
Пример #16
0
    public void RPC_CreatePlayer()
    {
        float randomValue = Random.Range(0f, 15f);

        PhotonNetwork.Instantiate(Path.Combine("Prefabs", "NewPlayer"), Vector3.up * randomValue, Quaternion.identity, 0);
    }
 public override void OnDisable()
 {
     PhotonNetwork.RemoveCallbackTarget(this);
 }
Пример #18
0
 public override void OnDisable()
 {
     base.OnDisable();
     PhotonNetwork.RemoveCallbackTarget(this);
     SceneManager.sceneLoaded -= OnSceneFinishedLoading;
 }
 public override void OnEnable()
 {
     PhotonNetwork.AddCallbackTarget(this);
 }
Пример #20
0
 public void JoinRoom()
 {
     joinButton.SetActive(false);
     PhotonNetwork.JoinRandomRoom();
     print("Trying to join a room ...");
 }
Пример #21
0
        // below, we implement some callbacks of PUN
        // you can find PUN's callbacks in the class PunBehaviour or in enum PhotonNetworkingMessage


        public virtual void OnConnectedToMaster()
        {
            Debug.Log("OnConnectedToMaster() was called by PUN. Now this client is connected and could join a room. Calling: PhotonNetwork.JoinRandomRoom();");
            PhotonNetwork.JoinRandomRoom();
        }
Пример #22
0
 public override void OnMasterClientSwitched(PhotonPlayer newMasterClient)
 {
     PlayerLeftRoom(newMasterClient);
     PhotonNetwork.LeaveRoom();
 }
Пример #23
0
 public virtual void OnJoinedLobby()
 {
     Debug.Log("OnJoinedLobby(). This client is connected and does get a room-list, which gets stored as PhotonNetwork.GetRoomList(). This script now calls: PhotonNetwork.JoinRandomRoom();");
     PhotonNetwork.JoinRandomRoom();
 }
Пример #24
0
 public void CreateLobby()
 {
     PhotonNetwork.CreateRoom("Test7"); //, true, true, 2);
 }
Пример #25
0
 // Use this for initialization
 void Start()
 {
     PhotonNetwork.ConnectUsingSettings("0.1");
     PhotonNetwork.logLevel = PhotonLogLevel.Full;
 }
Пример #26
0
 public void BackToLooby()
 {
     PhotonNetwork.LeaveRoom();
 }
Пример #27
0
 /// <summary>Called by Unity when the application is closed. Tries to disconnect.</summary>
 protected void OnApplicationQuit()
 {
     PhotonHandler.AppQuits = true;
     PhotonHandler.StopFallbackSendAckThread();
     PhotonNetwork.Disconnect();
 }
Пример #28
0
        /**
         * Description:
         */
        private void OnButtonLeaveClicked()
        {
            PhotonNetwork.LeaveRoom();

            Open(_menuRoomBrowser);
        }
Пример #29
0
 private void RPC_LoadGameOthersLevel7()
 {
     PhotonNetwork.LoadLevel(11);
 }
Пример #30
0
 public void randomButtons
 {
     PhotonNetwork.g
Пример #31
0
 public void CreatePlayer()
 {
     PhotonNetwork.ConnectUsingSettings("1");
 }