Table of Contents

Class AxolotlModuleContext

Namespace
Axolotl2D.Packages
Assembly
Axolotl2D.dll

The intentionally small API exposed while initializing trusted module code.

public sealed class AxolotlModuleContext
Inheritance
AxolotlModuleContext
Inherited Members

Properties

Package

The package being initialized.

public AxolotlPackage Package { get; }

Property Value

AxolotlPackage

Services

The game's root service provider. Registrations cannot mutate the built container.

public IServiceProvider Services { get; }

Property Value

IServiceProvider

Methods

RegisterAssetLoader(Type, Type)

Stages a runtime loader for registration after initialization succeeds.

public void RegisterAssetLoader(Type assetType, Type loaderType)

Parameters

assetType Type
loaderType Type

RegisterExtension<TContract>(string, TContract)

Stages an implementation of a game-defined extension contract.

public void RegisterExtension<TContract>(string id, TContract extension) where TContract : class

Parameters

id string
extension TContract

Type Parameters

TContract

RegisterGameObject(string, AxolotlGameObjectFactory)

Stages a package GameObject factory under a stable game-wide ID.

public void RegisterGameObject(string id, AxolotlGameObjectFactory factory)

Parameters

id string
factory AxolotlGameObjectFactory

RegisterPrefabComponent<TComponent>(string)

Stages a trusted module component under a stable prefab ID.

public void RegisterPrefabComponent<TComponent>(string id) where TComponent : Component, IPrefabDataReceiver

Parameters

id string

Type Parameters

TComponent

RegisterScene(string, Type)

Stages a package scene type discovered at build time.

public void RegisterScene(string id, Type sceneType)

Parameters

id string
sceneType Type

RegisterScene<TScene>(string)

Stages a package scene under a stable game-wide ID.

public void RegisterScene<TScene>(string id) where TScene : BaseScene

Parameters

id string

Type Parameters

TScene