Example #1
0
 void Start()
 {
     if (PlayerPrefsExtra.HasKey("connect_IP"))
     {
         connectToIP = PlayerPrefsExtra.GetString("connect_IP");
     }
     if (PlayerPrefsExtra.HasKey("connect_Port"))
     {
         connectPort = PlayerPrefsExtra.GetInt("connect_Port");
         autoConnect = (PlayerPrefsExtra.GetInt("connect_autoConnect") == 1);
     }
     if (PlayerPrefsExtra.HasKey("connect_sendRate"))
     {
         sendRate         = PlayerPrefsExtra.GetInt("connect_sendRate");
         Network.sendRate = sendRate;
     }
     if (autoConnect)
     {
         isServer = (PlayerPrefsExtra.GetInt("connect_isServer") == 1) ? true : false;
         if (isServer)
         {
             connectAsServer();
         }
         else
         {
             connectAsClient();
         }
     }
 }