public static void BuildClient(BuildArgs buildArgs, string[] scenes)
        {
            Console.WriteLine("#### BuildClient: Start");

            var outputPath = GetClientOutputPath(buildArgs);

            //System.IO.Directory.CreateDirectory(buildArgs.OutputDir);

            try
            {
                Console.WriteLine("#### BuildClient: Switching target to " + buildArgs.Target);
                EditorUserBuildSettings.SwitchActiveBuildTarget(buildArgs.TargetGroup, buildArgs.Target);

                Console.WriteLine("#### BuildClient: Build player output to " + outputPath);
                string res = BuildPipeline.BuildPlayer(scenes, outputPath, buildArgs.Target, BuildOptions.None);

                PlayerSettings.SetScriptingDefineSymbolsForGroup(buildArgs.TargetGroup, string.Empty);

                if (res.Length > 0)
                {
                    throw new Exception("BuildPlayer failure: " + res);
                }
            }
            catch (Exception e)
            {
                throw new Exception("BuildPlayer failure: " + e.Message);
            }

            Console.WriteLine("#### BuildClient: End");
        }
        public static void BuildClient(BuildArgs buildArgs, string[] scenes)
        {
            Console.WriteLine("#### BuildClient: Start");

            var outputPath = GetClientOutputPath(buildArgs);

            System.IO.Directory.CreateDirectory(buildArgs.OutputDir);

            try
            {
                Console.WriteLine("#### BuildClient: Switching target to " + buildArgs.Target);
                EditorUserBuildSettings.SwitchActiveBuildTarget(buildArgs.Target);

                Console.WriteLine("#### BuildClient: Build player output to " + outputPath);
                string res = BuildPipeline.BuildPlayer(scenes, outputPath, buildArgs.Target, BuildOptions.None);

                PlayerSettings.SetScriptingDefineSymbolsForGroup(buildArgs.TargetGroup, string.Empty);

                if (res.Length > 0)
                {
                    throw new Exception("BuildPlayer failure: " + res);
                }

            }
            catch (Exception e)
            {
                throw new Exception("BuildPlayer failure: " + e.Message);
            }

            Console.WriteLine("#### BuildClient: End");
        }
        public static void BuildClient_BatchMode()
        {
            Console.WriteLine("### BuildClient_BatchMode");

            var buildArgs = new BuildArgs();

            BuildClient(buildArgs, GetEnabledScenePaths());
        }
        public static void BuildClient_BatchMode()
        {
            Console.WriteLine("### BuildClient_BatchMode");

            var buildArgs = new BuildArgs();

            BuildClient(buildArgs, GetEnabledScenePaths());
        }
        public static string GetClientOutputPath(BuildArgs buildArgs)
        {
            var path = buildArgs.OutputDir;

            // Post-processing doesn't work nicely with trailing slash
            path = path.TrimEnd('/');

            return(path);
        }
        public static string GetClientOutputPath(BuildArgs buildArgs)
        {
            var path = buildArgs.OutputDir;

            // Post-processing doesn't work nicely with trailing slash
            path = path.TrimEnd('/');

            return path;
        }