Esempio n. 1
0
 public void InitializeWorldBuilder()
 {
     if (gameTypeDropdown.value == 0)         // Web
     {
         worldBuilder.CreateWeb();
     }
     else if (gameTypeDropdown.value == 1)         // Private
     {
         worldBuilder.CreatePrivate();
     }
     else if (gameTypeDropdown.value == 2)         // LAN
     {
         worldBuilder.CreateLAN(Guid.NewGuid());
     }
     else         //  Join LAN
     {
         var games = worldBuilder.GetGames();
         var name  = gameTypeDropdown.options[gameTypeDropdown.value].text;
         if (gameTypeDropdown.options.Any(option => option.text == name))
         {
             worldBuilder.JoinLAN(games[name]);
         }
     }
 }