Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/joshcamas/eventstack
- Owner: joshcamas
- Created: 2019-05-21T17:44:14.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-21T17:50:13.000Z (almost 6 years ago)
- Last Synced: 2024-11-08T22:37:11.255Z (3 months ago)
- Language: C#
- Size: 1.95 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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; });
}
```