Exemplo n.º 1
0
    public static void AndroidCustomBuild()
    {
        CustomBuildSetupEnv customBuildSetup = 
            new CustomBuildAndroidSetupEnv(new BDSAppcoinsGameObject());

        CustomBuildWindow customBuildWindow = 
            ScriptableObject.CreateInstance<AndroidCustomBuildWindow>();

        CustomBuildUnityExport customBuildUnityExport =
            GetCustomBuildUnityExport2018();

        CustomBuildProjectBuild customBuildProjectBuild = 
            new CustomBuildGradleProjectBuild();

        CustomBuildProjectInstall customBuildProjectInstall = 
            new CustomBuildAdbProjectInstall();

        CustomBuildProjectRun customBuildProjectRun = 
            new CustomBuildAdbProjectRun();

        CustomBuildErrorTitles eT = new CustomBuildAndroidErrorTitles();

        CustomBuild c = new CustomBuild(customBuildSetup, customBuildWindow,
                                        customBuildUnityExport,
                                        customBuildProjectBuild,
                                        customBuildProjectInstall,
                                        customBuildProjectRun,
                                        eT
                                       );
        c.RunProcess();
    }
Exemplo n.º 2
0
        /// <summary>
        /// The build pipeline used when pressing "Build" in Trail SDK Editor
        /// </summary>
        /// <returns>The build report given by Unity</returns>
        public static BuildReport Build()
        {
            if (EditorApplication.isCompiling)
            {
                EditorUtility.DisplayDialog("Build Failed", "Can't do build while compling code!", "Ok");
                return(null);
            }
            if (EditorApplication.isPlaying)
            {
                if (EditorUtility.DisplayDialog("Build", "Can't do build while playing, do you want to stop playmode?", "Yes", "Cancel"))
                {
                    EditorApplication.isPlaying = false;
                }
                else
                {
                    return(null);
                }
            }

            if (OnPreBuild != null)
            {
                OnPreBuild.Invoke();
            }

            BuildReport report = CustomBuild != null?CustomBuild.Invoke() : DefaultBuild();

            UpdateBuildCache(report);
            return(report);
        }
Exemplo n.º 3
0
    protected string GenericBuild(string[] scenesPath, string target_dir, BuildTarget build_target, BuildOptions build_options)
    {
        string path = this.SelectPath();

        if (path == null || path.Length == 0)
        {
            return(null);
        }

        string projPath = CustomBuild.GetProjectPath();

        if (path == projPath)
        {
            EditorUtility.DisplayDialog("Custom Build", "Please pick a folder that is not the project root", "Got it");
            return(null);
        }

        this.DeleteIfFolderAlreadyExists(path);

        #if UNITY_5_6_OR_NEWER
        EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Android, BuildTarget.Android);
        #else
        EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.Android);
        #endif

        BuildPipeline.BuildPlayer(scenesPath, path, build_target, build_options);
        return(path);
    }
    public static void ApplySettings()
    {
        var options = new Dictionary <string, Action>
        {
            { "gamma", () => PlayerSettings.colorSpace = ColorSpace.Gamma },
            { "linear", () => PlayerSettings.colorSpace = ColorSpace.Linear },
            { "glcore", () => SetGraphicsAPI(GraphicsDeviceType.OpenGLCore) },
            { "d3d11", () => SetGraphicsAPI(GraphicsDeviceType.Direct3D11) },
            { "d3d12", () => SetGraphicsAPI(GraphicsDeviceType.Direct3D12) },
            { "metal", () => SetGraphicsAPI(GraphicsDeviceType.Metal) },
            { "vulkan", () => SetGraphicsAPI(GraphicsDeviceType.Vulkan) },
            { "gles3", () => SetGraphicsAPI(GraphicsDeviceType.OpenGLES3) },
            { "gles2", () => SetGraphicsAPI(GraphicsDeviceType.OpenGLES2) },
            { "ps4", () => SetGraphicsAPI(GraphicsDeviceType.PlayStation4) },
#if UNITY_PS5
            { "ps5", () => SetGraphicsAPI(GraphicsDeviceType.PlayStation5) },
#endif
            { "xb1d3d11", () => SetGraphicsAPI(GraphicsDeviceType.XboxOne) },
            { "xb1d3d12", () => SetGraphicsAPI(GraphicsDeviceType.XboxOneD3D12) },
#if UNITY_GAMECORE
            { "gamecorexboxone", () => SetGraphicsAPI(GraphicsDeviceType.GameCoreXboxOne) },
            { "gamecorexboxseries", () => SetGraphicsAPI(GraphicsDeviceType.GameCoreXboxSeries) },
#endif
            { "switch", () => SetGraphicsAPI(GraphicsDeviceType.Switch) }
        };

        var    args    = Environment.GetCommandLineArgs();
        string apiName = "";

        foreach (var arg in args)
        {
            Action action;
            if (options.TryGetValue(arg, out action))
            {
                apiName = arg;
                action();
            }
        }

        CustomBuild.BuildScenes(".", apiName, EditorUserBuildSettings.activeBuildTarget);
    }
Exemplo n.º 5
0
    public static void CallAndroidCustomBuild()
    {
        CustomBuild buildObj = new CustomBuild();

        buildObj.ExecuteCustomBuild("android");
    }