Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/joshcamas/eventstack

Add events and mods to Unity3D with ease
https://github.com/joshcamas/eventstack

Last synced: about 2 months ago
JSON representation

Add events and mods to Unity3D with ease

Awesome Lists containing this project

README

        

# EventStack
Add events and value mods to Unity3D with ease. Especially useful for RPGs! An Event Stack is essentially a list of delegates which run one after the other, each modifying the input value and finally returning the final value. In my game, I use them for my perk system, to allow my perks to modify a huge number of different values for my characters.

Simple Example:
```
//On Character
public EventStack ModifyWalkSpeed;

public float GetWalkSpeed()
{
float speed = speed * agility + 3;
return ModifyWalkSpeed.RunStack(speed);
}

...

public void RegisterSpeedBoostPerk()
{
character.ModifyWalkSpeed.RegisterMod((speed) => { return speed * 2; });
}
```