Example #1
0
 public void OnEnable()
 {
     if (networkManager != null)
     {
         Debug.Log("Join Game Enabled.");
         if (networkManager.matchMaker == null)
         {
             Debug.Log("Enabling Matchmaker");
             networkManager.StartMatchMaker();
         }
         Refresh();
     }
     else
     {
         Debug.LogError("OnEnable :: NetworkManager not found");
     }
     if (networkDiscovery != null)
     {
         Debug.Log("Started Listening for LAN Servers");
         networkDiscovery.Initialize();
         networkDiscovery.StartListeningForServers();
     }
     else
     {
         Debug.LogError("OnEnable :: NetworkDiscovery not found");
     }
 }
Example #2
0
 // Use this for initialization
 void Start()
 {
     networkManager   = NetworkManager.singleton;
     networkDiscovery = OverrideNeworkDiscovery.singleton;
     if (networkManager.matchMaker == null)
     {
         Debug.Log("Enabling Matchmaker");
         networkManager.StartMatchMaker();
     }
     if (networkDiscovery != null)
     {
         Debug.Log("Started Listening for LAN Servers");
         networkDiscovery.Initialize();
         networkDiscovery.StartListeningForServers();
     }
 }