docs.unity3d.com
    Show / Hide Table of Contents

    Class SampleBuildProcessor

    Simple build processor that makes sure that any custom configuration that the user creates is correctly passed on to the provider implementation at runtime.

    Custom configuration instances that are stored in EditorBuildSettings are not copied to the target build as they are considered unreferenced assets. In order to get them to the runtime side of things, they need to be serialized to the build app and deserialized at runtime. Previously this would be a manual process requiring the implementor to manually serialize to some location that can then be read from to deserialize at runtime. With the new PlayerSettings Preloaded Assets API we can now just add our asset to the preloaded list and have it be instantiated at app launch.

    Note that the preloaded assets are only notified with Awake, so anything you want or need to do with the asset after launch needs to be handled there.

    More info on APIs used here:

    • <a href="https://docs.unity3d.com/ScriptReference/EditorBuildSettings.html">EditorBuildSettings</a>
    • <a href="https://docs.unity3d.com/ScriptReference/PlayerSettings.GetPreloadedAssets.html>PlayerSettings.GetPreloadedAssets</a>
    • <a href="https://docs.unity3d.com/ScriptReference/PlayerSettings.SetPreloadedAssets.html">PlayerSettings.SetPreloadedAssets</a>
    Inheritance
    Object
    SampleBuildProcessor
    Namespace: Samples
    Syntax
    public class SampleBuildProcessor : IPreprocessBuildWithReport, IPostprocessBuildWithReport

    Properties

    callbackOrder

    Override of and

    Declaration
    public int callbackOrder { get; }
    Property Value
    Type Description
    Int32

    Methods

    OnPostprocessBuild(BuildReport)

    Override of

    Declaration
    public void OnPostprocessBuild(BuildReport report)
    Parameters
    Type Name Description
    BuildReport report

    Build report.

    OnPreprocessBuild(BuildReport)

    Override of

    Declaration
    public void OnPreprocessBuild(BuildReport report)
    Parameters
    Type Name Description
    BuildReport report

    Build report.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023