问题
I'm getting really frustrated with @Frank-van-Puffelen who closed my questions just because they don't contain minimum reproducible code. This is a valid question and there are useful answers out there. I made a duplicate question because I felt my first (this one) was closed unfairly and is not getting reopened. Now I cannot delete my second nor this one because Frank-van-Puffelen answered and then closed it. Frank, if you don't understand, then let someone else answer or ask for more information. Don't just immediately close this. I need mod assistance.
My Firebase app works in the editor, and it works in build, but when I try to run both at the same time, the second instance crashes once the first Firebase command is invoked (firestore snapshot).
I suspect that I may need to create a firebase instance with a different name, but I'm not sure how. Right now the two instances both use Firebase.DefaultInstance.
The crash gives no errors, and the editor logs show everything runs fine until
Query q = db.Collection("matches").OrderByDescending("players");
QuerySnapshot snapSht = await q.GetSnapshotAsync();
How do I run a second Unity-Firebase instance on a single local machine for multiplayer testing?
Steps to reproduce problem:
- Install and set up firebase in Unity per the documentation
- Initialize the app and fetch a snapshot from Firestore
- Build and run the app
- While build is running, press play in Unity Editor. Once the snapshot code runs, Unity will crash. If Editor is run first, the build will be the one to crash
来源:https://stackoverflow.com/questions/64934421/unity-how-to-test-firebase-multiplayer-build-and-editor-at-the-same-time