Skip to content

Instantly share code, notes, and snippets.

@DylanYasen
Created January 12, 2021 05:14
Show Gist options
  • Save DylanYasen/3a9a4bde05d0854adcf851aaabec9a41 to your computer and use it in GitHub Desktop.
Save DylanYasen/3a9a4bde05d0854adcf851aaabec9a41 to your computer and use it in GitHub Desktop.
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