🧑💻Setup
Last updated
Last updated
First and foremost you need to add the package to Unity. In Unity navigate to Windows > Package Manager. Then in the top left click the "+" symbol, and select "Add package from git URL".
Next, copy the following URL into the text box that appeared.
If you haven't used the framework before, it is highly recommended to import the samples as they will give you a good idea of how to implement custom effects. You can add them through the package manager in the samples tab of the Status Effect Framework package.
It isn't required to edit the settings, however it may help save time if you setup your effect groups and status names beforehand.
Good to know: Make sure to check out Status Effect Settings for more info.
You can create your own custom StatusEffectData by right clicking the project file browser, and navigating to Create > Status Effect Data. There are many settings you can tweak, but the main two you should change are the Base Value and the Effects list. Go ahead and add your first effect.
You can change the status name to be whatever you want, just know that it will only affect a StatusVariable with the same status name. Additionally you can tweak the value type and modifier.
Good to know: Make sure to check out Value Modifier for more info.
It is important to use Base Value for something, it doesn't need to be in effect (it could be used in custom effect) but it should be used somewhere. The value is used to calculate non-stacking behavior so to make our first effect use the base value you can select the bool next to Float Value.
Obviously you don't want to completely rewrite your current entities or characters or whatever they may be just to implement simple status effects. Luckily its as easy as implementing an interface! As long as your class inherits from IStatus and MonoBehaviour its ready to use Status Effects!
Check out an example implementation here:
IStatusNext just add any StatusVariables that need to be effected by StatusEffects and you're good to go!
All you need to do to add or remove StatusEffects is call the extension methods. That's it!
Again it is recommended to check out the samples, as they show a rough idea of how to get started. If you want more customized effects you may also want to check out CustomEffects.
If you encounter any issues or would like to make a pull request feel free to do so I am open to feedback!
You can also reach out to me on Discord if you have any questions.