Created
January 12, 2021 05:14
-
-
Save DylanYasen/3a9a4bde05d0854adcf851aaabec9a41 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AbilitySelectedEvent : Event | |
{ | |
public uint abilityId; | |
public uint playerId; | |
} | |
// registering | |
EventManager eventManager; | |
eventManager.RegisterForEvent<AbilitySelectedEvent>(this, (AbilitySelectedEvent payload) => | |
{ | |
Debug.Log(payload.abilityId); | |
}); | |
// triggering | |
var payload = new AbilitySelectedEvent | |
{ | |
abilityId = 23, | |
playerId = 0 | |
}; | |
eventManager.TriggerEvent<AbilitySelectedEvent>(payload); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment