Skip to content

UnityEffectLoader

Inherits MonoBehaviour

Public Member Functions

void

LoadAssembly(string assemblyPath)

Dynamically loads an assembly containing effect implementations and registers them with the loader. This method is only available when running with Mono support enabled. This can be used to dynamically load effect assemblies at runtime, allowing for greater flexibility in how effects are defined and organized. The assembly must contain types that implement the IEffect interface in order to be registered with the loader. Note that loading assemblies at runtime can have security implications and should be done with caution, ensuring that only trusted assemblies are loaded. This method is not supported in IL2CPP builds, as IL2CPP does not support dynamic assembly loading. In IL2CPP builds, all effects must be included in the build at compile time and discovered through the standard Unity component scanning process.

Private Functions

void

Start()

Unity lifecycle method that initializes the effect registry by scanning child components.

void

OnDestroy()

Unity lifecycle method that clears the effect registry when the loader is destroyed.

void

IEffectLoader.Load()

Documentation inherited from IEffectLoader.Load.

void

IEffectLoader.Unload()

Documentation inherited from IEffectLoader.Unload.

Properties

IDictionary

Effects

[get, ]

Gets a mapping of effect IDs to their corresponding IEffect handlers.