# Custom Build Environment

When building the project using editor's build menu, Naninovel automatically executes additional pre- and post-processing procedures. Those procedures, among other things, include ensuring that all the resources assigned via Naninovel's configuration menus (eg, script documents, character appearances, BGM and SFX clips, etc) are included to the build.

In case you're using a custom build environment (eg, Cloud Build or starting the build via custom scripts or from the command line) you have to manually invoke Naninovel.BuildProcessor.PreprocessBuild(BuildPlayerOptions) and Naninovel.BuildProcessor.PostprocessBuild() static methods before and after the build respectively.

Below is an example of Cloud Build custom build processing script, which invokes the required Naninovel processing methods. Consult the official service docs on how to setup the processing scripts.

public static class CustomBuildProcessor 
    public static void PreExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
        var options = new UnityEditor.BuildPlayerOptions();
        var cloudBuildTargetName = manifest.GetValue<string>("cloudBuildTargetName").ToString().ToLower();

        if (cloudBuildTargetName.Contains("windows") && cloudBuildTargetName.Contains("64"))
            options.target = UnityEditor.BuildTarget.StandaloneWindows64;
        else if (cloudBuildTargetName.Contains("windows"))
            options.target = UnityEditor.BuildTarget.StandaloneWindows;
        else if (cloudBuildTargetName.Contains("android"))
            options.target = UnityEditor.BuildTarget.Android;
        else if (cloudBuildTargetName.Contains("webgl"))
            options.target = UnityEditor.BuildTarget.WebGL;
        else throw new System.ArgumentException($"Unhandled cloudBuildTargetName: {cloudBuildTargetName}");

    public static void PostExport(string exportPath)

In case you're using you own custom build handler, which supposed to be triggered with the editor's build menu, it's possible to disable the Naninovel's handler by disabling Enable Build Processing property in the "Resource Provider" configuration menu. When enabling or disabling the property, restart Unity editor in order for the change to take effect.

Last Updated: February 16, 2021