Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How exactly do your events work? #20

Open
Shadowblitz16 opened this issue Jun 1, 2023 · 3 comments
Open

How exactly do your events work? #20

Shadowblitz16 opened this issue Jun 1, 2023 · 3 comments

Comments

@Shadowblitz16
Copy link

How exactly do your events work?
They don't seem to take in EventArgs and they don't seem to support multiple subscribers.

@Ellpeck
Copy link
Owner

Ellpeck commented Jun 1, 2023

Hi! Coroutine events aren't traditional C# events, they're just called the same.

You can find info about how to raise and wait for coroutine events in the README, but essentially, all that coroutine events are is a cue for a coroutine to wait for, rather than waiting for time to pass.

Possible use cases for this are waiting until an object has been updated in a game, or waiting until a loading screen has passed.

Please let me know if you have any specific questions!

@Shadowblitz16
Copy link
Author

Shouldn't they at least be a delegate? I don't see why a class is used

@Ellpeck
Copy link
Owner

Ellpeck commented Jun 1, 2023

Waiting for events doesn't involve delegates.

Events are single-instance (or you can extend Event and override Equals if you need to), and waiting for an event just waits for the next time that the event is raised. There is no additional data being passed, and there are no traditional event subscriptions involved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants