> For the complete documentation index, see [llms.txt](https://maraudical.gitbook.io/status-effects-framework/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://maraudical.gitbook.io/status-effects-framework/1.2.0/setup.md).

# Setup

## Install the package

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"**.

<figure><img src="https://drive.google.com/uc?id=1Dk_6yUiOrMR2ZZ0-DPYmXo7iECUbjXUk" alt="" width="375"><figcaption></figcaption></figure>

Next, copy the following **URL** into the text box that appeared.

```url
https://github.com/maraudical/StatusEffectsFramework-Unity.git
```

## Import Samples (Optional)

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.

## Edit Settings (Optional)

It isn't required to edit the settings, however it may help save time if you setup your effect groups and status names beforehand.

{% hint style="info" %}
**Good to know:** Make sure to check out [Status Effect Settings](/status-effects-framework/1.2.0/settings.md) for more info.
{% endhint %}

## Creating Your First Status Effect

You can create your own custom [StatusEffectData](/status-effects-framework/1.2.0/type-specifics/classes/statuseffectdata.md) 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.

<figure><img src="https://drive.google.com/uc?id=1XIyqafncOIlgeExG6Hkf_5QYuwSaT1kY" alt="" width="563"><figcaption></figcaption></figure>

You can change the status name to be whatever you want, just know that it will only affect a [StatusVariable ](/status-effects-framework/1.2.0/type-specifics/classes/statusvariable.md)with the same status name. Additionally you can tweak the value type and modifier.&#x20;

{% hint style="info" %}
**Good to know:** Make sure to check out [Value Modifier](/status-effects-framework/1.2.0/type-specifics/classes/statuseffectdata/effect.md#value-modifier) for more info.
{% endhint %}

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](/status-effects-framework/1.2.0/type-specifics/classes/statuseffectdata.md#non-stacking-behaviour) so to make our first effect use the base value you can select the bool next to Float Value.

<figure><img src="https://drive.google.com/uc?id=1ECadr7HMsGDuoPuH52xauSc5DmCIdzTQ" alt="" width="375"><figcaption></figcaption></figure>

## How to Add Status Effects To Your Classes

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](/status-effects-framework/1.2.0/type-specifics/interfaces/istatus.md) and [MonoBehaviour](https://docs.unity3d.com/ScriptReference/MonoBehaviour.html) its ready to use Status Effects!

Check out an **example implementation** here:

{% content-ref url="/pages/sETXNaFAFXVtrsTXGe9y" %}
[IStatus](/status-effects-framework/1.2.0/type-specifics/interfaces/istatus.md)
{% endcontent-ref %}

Next just add any [StatusVariables](/status-effects-framework/1.2.0/type-specifics/classes/statusvariable.md) that need to be effected by [StatusEffects](/status-effects-framework/1.2.0/type-specifics/classes/statuseffect.md) and you're good to go!

```csharp
// Dont forget to use the StatusEffect namespace!
// Example variables
public StatusFloat maxHealth;
public StatusInt coinMultiplier;
public StatusBool stunned;
```

<figure><img src="https://drive.google.com/uc?id=1JPTCV_Dd86kraBLFgalLKn5bDrrYQnRj" alt="" width="563"><figcaption></figcaption></figure>

All you need to do to add or remove [StatusEffects](/status-effects-framework/1.2.0/type-specifics/classes/statuseffect.md) is call the [extension methods](/status-effects-framework/1.2.0/type-specifics/interfaces/istatus.md#extensions). That's it!

## Important Information/Links

Again it is recommended to check out the [samples](https://github.com/maraudical/StatusEffectsFramework-Unity/tree/main/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](/status-effects-framework/1.2.0/type-specifics/classes/customeffect.md).

If you encounter any [issues](https://github.com/maraudical/StatusEffectsFramework-Unity/issues) or would like to make a [pull request](https://github.com/maraudical/StatusEffectsFramework-Unity/pulls) feel free to do so I am open to feedback!

You can also reach out to me on [Discord](https://discordapp.com/users/285622166026977282) if you have any questions.
