Skip to content
Nathan Gill edited this page Nov 3, 2020 · 1 revision

The CustomSceneLoader class and attribute is used to override the default method of loading scenes for use with custom game modes. In sandbox scenes this doesn't change anything other than the base scene to initialize in and in Take and Hold scenes it is used to setup the hold point order and other initialization tasks.

Example breakdown:

// This attribute tells the loader which game mode your loader is used for.
[CustomSceneLoader("h3vr.sandbox")]
public class SandboxSceneLoader : CustomSceneLoader
{
    // This tells the loader which scene to load first to pull over all necessary game mechanics
    public override string BaseScene => "ProvingGround";

    // This method is called by the loader as soon as the base scene has finished loading.
    public override void PreLoad()
    {
    }

    // This method is called by the loader after the modded scene has been loaded and all proxies resolved, but before deactivated game objects are reactivated
    public override void Resolve()
    {
    }

    // This method is called by the loader after everything is done at the very end of the load process
    public override void PostLoad()
    {
    }
}
Clone this wiki locally