From the course: Unity: Working with Google Firebase

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Use delegates and events

Use delegates and events

From the course: Unity: Working with Google Firebase

Start my 1-month free trial

Use delegates and events

- [Instructor] Because we want to keep our off manager separated out from our game code, we need some way to pass information back from our off manager to the form manager. We also need a way of letting the form manager know when an off event has been triggered. So if you're saying to yourself, "well, let's just use the delegate pattern to create callback events," you'd be right on the money, because that's exactly what we're going to do. To top this script, we need another using directive. Using system.threading.tasks. That's going to allow us to pass a task back through our callback, and we're going to be using the task we get back from our fire base, to create user with email and password call. If you've never used delegates or events before, they're exactly what they sound like. Delegates are essentially function lists that can be subscribed to by other scripts in our game. When a delegate method is called, it'll also call any method on any script that has subscribed to that…

Contents