public static void Execute()
    {
        int option = EditorUtility.DisplayDialogComplex("Build with Addressables",
                                                        "Do you want to build a clean addressables before export? This will clear any existing addressables files.",
                                                        "Build with Addressables",
                                                        "Skip",
                                                        "Cancel");

        switch (option)
        {
        // Build with Addressables.
        case 0:
            BuildAddressablesProcessor.PreExport();
            break;

        // Skip.
        case 1:
            break;

        // Cancel.
        case 2:
            BuildAddressablesProcessor.cancelBuild = true;
            break;

        default:
            Debug.LogError("How did you get this.");
            break;
        }

        EditorUtility.GetDialogOptOutDecision(DialogOptOutDecisionType.ForThisMachine, "BuildAddressablesBeforeBuildPref");
        EditorUtility.SetDialogOptOutDecision(DialogOptOutDecisionType.ForThisMachine, "BuildAddressablesBeforeBuildPref", BuildAddressablesProcessor.showWarningBeforeBuild);
    }
示例#2
0
    private static void BuildPlayerHandler(BuildPlayerOptions options)
    {
        if (UnityEngine.Debug.isDebugBuild)
        {
            bool shouldIncrement = EditorUtility.DisplayDialog(
                "Increment Version?",
                $"Current: {PlayerSettings.bundleVersion}",
                "Yes",
                "No"
                );

            if (shouldIncrement)
            {
                IncreaseBothVersions();
            }
        }

        //ask to build addressable
        if (EditorUtility.DisplayDialog("Build with Addressables",
                                        "Do you want to build a clean addressables before export?",
                                        "Build with Addressables", "Skip"))
        {
            BuildAddressablesProcessor.PreExport();
        }
        BuildPlayerWindow.DefaultBuildMethods.BuildPlayer(options);
    }
示例#3
0
    public static void BuildAndroidClient()
    {
        //AddressableAssetSettings.CleanPlayerContent();
        //AddressableAssetSettings.BuildPlayerContent();
        BuildAddressablesProcessor.PreExport();

        var path   = "../bin/client/android/";
        var name   = "broyal-client.apk";
        var target = BuildTarget.Android;
        var option = BuildOptions.None;

        var scriptingImplementation = ScriptingImplementation.IL2CPP;

        BuildReport  report  = BuildGame(clientScenes, path, name, target, option, "1", scriptingImplementation);
        BuildSummary summary = report.summary;

        if (summary.result == BuildResult.Succeeded)
        {
            Debug.Log("Build succeeded: " + summary.totalSize + " bytes");
        }

        if (summary.result == BuildResult.Failed)
        {
            Debug.Log("Build failed");
        }

        //
        // // Copy a file from the project folder to the build folder, alongside the built game.
        // FileUtil.CopyFileOrDirectory("Assets/Templates/Readme.txt", path + "Readme.txt");
        //
        // // Run the game (Process class from System.Diagnostics).
        // Process proc = new Process();
        // proc.StartInfo.FileName = path + "/BuiltGame.exe";
        // proc.Start();
    }