Module
Abstract Scriptable Object
Last updated
Abstract Scriptable Object
Last updated
Modules are a way to add additional functionality to each StatusEffectData. Create one by simply inheriting from the Module class and implementing the required methods.
You NEED to use the StatusEffects.Modules namespace like in the example below for both Modules and ModuleInstances.
Truthfully anything can be done with them as they are just an inheritable abstract class with a coroutine, allowing for unlimited functionality. It is highly recommended to take a look at the samples for an idea of how to use them.
Make sure to checkout ModuleInstance to see how you can setup unique module data per StatusEffectData!
Note that if you have UniTask in your project then the Module will use UniTasks over Coroutines. This is also included in the samples, but note that the only real difference is that there is no DisableModule abstract method because you can just wait until cancellation is requested on the token.
Note that if you are using Unity 2023.1 or later then the Module will use Awaitable over Coroutines. Like UniTask it is also included in the samples and the DisableModule abstract method is not used.
EnableModule | A Coroutine that is started when the StatusEffect begins. |
DisableModule | A method that is invoked when the StatusEffect is stopped. |