Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Photon offline mode

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

  1. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    275
    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