Beispiel #1
0
    public static void BuildAndroid()
    {
        // Build player options, for building the game
        BuildPlayerOptions bpo = new BuildPlayerOptions();

        // Set everything to work fine when building
        bpo.scenes           = new[] { "Assets/Scenes/MainMenu.unity", "Assets/Scenes/LevelSelection.unity", "Assets/Scenes/Game.unity" };
        bpo.locationPathName = "../AndroidBuild/OneLine.apk";
        bpo.target           = BuildTarget.Android;
        bpo.options          = BuildOptions.None;

        // Check game_data file and create it if don't exists
        if (!File.Exists("Assets/StreamingAssets/game_data.json"))
        {
            CreateGameInfo.CreateInfo();
        }

        // Build game
        BuildReport  rp = BuildPipeline.BuildPlayer(bpo);
        BuildSummary bs = rp.summary;

        // Build result management
        if (bs.result == BuildResult.Succeeded)
        {
            Debug.Log("Build suceeded: " + bs.totalSize + " bytes");
        }

        if (bs.result == BuildResult.Failed)
        {
            Debug.Log("Build failed");
        }
    }
        public void SendCreateGame()
        {
            CreateGameInfo createGameInfo = new CreateGameInfo();

            createGameInfo.user_name     = context.gameCtrl.UserName;
            createGameInfo.my_turn       = context.gameCtrl.IsMyFirstMove() ? 1 : 0;
            createGameInfo.number_to_win = context.gameCtrl.NumberToWin;
            createGameInfo.size          = context.game.GetRowCellCount();
            string json = JsonConvert.SerializeObject(createGameInfo, Formatting.Indented);

            SendJsonData("POST", "/new_game", null, json);
        }
Beispiel #3
0
 public GameClient(WindBotInfo Info)
 {
     Username = Info.Name;
     Deck     = Info.Deck;
     DeckFile = Info.DeckFile;
     Dialog   = Info.Dialog;
     //////////kdiy///////
     Deckfolder = Info.Deckfolder;
     Deckpath   = Info.Deckpath;
     //////////kdiy///////
     Hand  = Info.Hand;
     Debug = Info.Debug;
     _chat = Info.Chat;
     //////////kdiy///////
     Seed = Info.Seed;
     //////////kdiy///////
     RoomId      = Info.RoomId;
     CreateGame  = Info.CreateGame;
     _serverHost = Info.Host;
     _serverPort = Info.Port;
     _roomInfo   = Info.HostInfo;
     _proVersion = Info.Version;
 }