ModuleInstance
Abstract Scriptable Object
Description
ModuleInstances can be attached to Modules so that unique data can be selected per StatusEffectData. Create one by simply inheriting from the ModuleInstance class or using Create > Status Effect Framework > Module Instance Script.
You NEED to use the StatusEffects.Modules namespace like in the example below for both Modules and ModuleInstances.
You do not need to add these to the create menu! As long as it is attached to a Module using the attribute it will be created automatically.
As an example, say you need a VFX prefab to be instantiated on each effect. Instead of having to create a unique Module for each prefab that you need, just add the variables you need in the ModuleInstance and attach it to the Module using the [AttachModuleInstance] attribute.
Now, every time you add a module to a StatusEffectData, it will instantiate those values for that effect making it so you only need to create one Module scriptable object with any constant values and then unique instance values will be displayed in each specific StatusEffectData.

Example
Last updated