

For the time being, this will work to illustrate my basic point. If I were actually doing something with the result of a Task, I’d have to build this class out a little more. Inside it, I wait for a task to complete with a standard continuation. I can now use yield return on a Task, such as the Tasks typically used for Firebase, to make my asynchronous logic read sequentially. Assertions public class FirebaseContinueWith : MonoBehaviour Auth using UnityEngine using UnityEngine. Let’s get started with a very innocent looking demo script: using Firebase using Firebase. Ideally even giving you more confidence to thread other parts of your game to provide your players with the smooth and responsive gameplay they expect from a modern video game. My goal with this post is to provide you the tools you need to not only safely use Firebase’s asynchronous function calls, but to do so in a way that best suits your own programming style and preferences. Unity itself isn’t super resilient to threaded logic, with most of the classes and functions in the UnityEngine namespace just flat out throwing exceptions if invoked off of the main Unity thread. The Firebase Unity SDK makes judicious use of asynchronous logic for many of its calls. JFirebase + Unity with logos Firebase and Tasks
