Пример #1
0
    void Awake()
    {
        DontDestroyOnLoad(this);
        GetComponent <NetworkView>().group = 1;

        mgs = GameObject.Find("MasterServerMenu").GetComponent <NetworkMasterServer>() as NetworkMasterServer;
    }
Пример #2
0
 public static void register(string ip, int port)
 {
     NetworkMasterServer.getUInt32FromIP(ip);
     ushort num  = (ushort)port;
     ushort num1 = (ushort)(num + 1);
     ushort num2 = (ushort)(num + 2);
 }
Пример #3
0
 void Awake()
 {
     // Network level loading is done in a seperate channel.
     DontDestroyOnLoad(this);
     networkView.group = 1;
     //Application.LoadLevel("EmptyScene");
     mgs = GameObject.Find("MasterServerMenu").GetComponent <NetworkMasterServer>() as NetworkMasterServer;
 }
Пример #4
0
 void Awake()
 {
     // Network level loading is done in a seperate channel.
     DontDestroyOnLoad(this);
     networkView.group = 1;
     //Application.LoadLevel("EmptyScene");
     mgs = GameObject.Find("MasterServerMenu").GetComponent<NetworkMasterServer>() as NetworkMasterServer;
 }
Пример #5
0
 void OnGUI()
 {
     if (!lockcursor)
     {
         if (GUI.Button(new Rect(10, 10, 90, 30), "Disconnect")) //Show disconnect button
         {
             Network.Disconnect();                               // Tell all the other clients you're disconnecting
             MasterServer.UnregisterHost();
             NetworkMasterServer nms = GameObject.Find("MasterServerMenu(Clone)").GetComponent("NetworkMasterServer") as NetworkMasterServer;
             nms.dc();
             Destroy(nms.gameObject);
             // Return to the Master Game Server Lobby because we pressed disconnect
             Application.LoadLevel("MasterGameServerLobby");
         }
     }
 }