You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 7, 2019. It is now read-only.
@@ -61,6 +63,77 @@ You will find the API is very similar to the Java/iOS versions except that:
61
63
classMember=newFirebase("mypath"); //holds a reference until the behavior is released
62
64
classMember.ValueChanged+= (...) => {...} ;
63
65
```
66
+
67
+
But beware, if you are going to access child objects you need to store these in variables too, otherwise GC will delete the reference as well. So instead of this:
68
+
```C#
69
+
classMember=newFirebase("mypath"); //holds a reference until the behavior is released
fb=newFirebase("mypath"); //holds a reference until the behavior is released
80
+
sampleChild=fb.Child("somechild"); // holds another child reference so GC doens't remove the reference to the child
81
+
sampleChild.ValueChanged+= (...) => {...} ;
82
+
}
83
+
```
84
+
85
+
If you are referencing objects correctly, you will likely need to re-open your Unity project because your event response function contained an error. At this moment an error in the event response function causes Firebase Unity to stop working during your entire Unity Editor session. You can debug this by catching the exception on the highest level, re-opening your Unity project, and running your scene again. You can now see the error and fix it. Note that you will need to re-open your project on every attempt until we fix this bug. After you have resolved your exception, your firebase event should be received normally again.
86
+
87
+
For example:
88
+
```C#
89
+
IFirebasefb;
90
+
IFirebasesampleChild;
91
+
voidsomeFunction() {
92
+
try {
93
+
fb=newFirebase("mypath"); //holds a reference until the behavior is released
94
+
sampleChild=fb.Child("somechild"); // holds another child reference so GC doens't remove the reference to the child
95
+
sampleChild.ValueChanged+= (...) => {...} ;
96
+
someBadFunction();
97
+
} catch(Exceptione) {
98
+
Debug.Log("Firebase Event Exception:");
99
+
Debug.Log(e);
100
+
}
101
+
}
102
+
```
103
+
104
+
* Threading: Unity does not allow game object modifications from any thread other than the Main thread. Firebase operates on a separate thread for performance reasons, and so you can not directly edit game objects from your firebase event responses. You can solve this by adding a Queue with actions to be fulfilled on the main thread. Create a new script inside Unity, add it to the game object you just added to the scene. Then insert this code.
* iOS: XCode fails to link. Please follow instructions located at: https://www.firebase.com/docs/ios/alternate-setup.html You will need to do this again if you do a full build/replace from Unity, but an incremental build will keep these settings.
65
138
* Mac: The plugin does not appear to be working at all for the player, but works for iOS and Android<p/>
66
139
It could be that you have not installed the Java6 legacy runtime https://support.apple.com/kb/DL1572?locale=en_US
0 commit comments