Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Photon offline mode

Discussion in 'Scripting' started by saifshk17, Jul 3, 2020.

  1. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    347
    Is there a way to use Photon Library in offline mode? I am trying to access two android devices that are connected to a single hotspot without internet. Is there a way to achieve the communication? I am using OfflineMode = true, but it does not work.

    Code (CSharp):
    1.     private void Start()
    2.     {
    3.         PhotonNetwork.OfflineMode = true;
    4.         PhotonNetwork.ConnectUsingSettings();
    5.         print("Connecting...");
    6.     }
    7.  
    8.     public override void OnConnectedToMaster()
    9.     {
    10.      
    11.         PhotonNetwork.JoinLobby(TypedLobby.Default);
    12.         print("Connected");
    13.         ConnectingMenu.SetActive(false);
    14.         MainMenu.SetActive(true);
    15.  
    16.     }
    17.  
    18.     public override void OnJoinedLobby()
    19.     {
    20.         print("On Joined Lobby");
    21.     }
    22.  
    23.     public override void OnJoinedRoom()
    24.     {
    25.         Debug.Log("Player has joined");
    26.     }
    27.  
    28.     public override void OnDisconnected(DisconnectCause cause)
    29.     {
    30.         print("DisconnectFrom Photon");
    31.         ConnectingMenu.SetActive(true);
    32.         MainMenu.SetActive(false);
    33.  
    34.     }
     
    Last edited: Jul 3, 2020
unityunity