In my project, I have quite a few listeners to listen to any changes in the database in real time. For some reason, these listeners remain even if I reload the scene using
Application.LoadLevel("mainScene");
It would be hassle enough to remove each listener individually, using
FirebaseDatabase.DefaultInstance
.RootReference
.Child("sub path 1")
.Child("sub path 2")
.ValueChanged -= SomeFunction;
FirebaseDatabase.DefaultInstance
.RootReference
.Child("path")
.ValueChanged -= AnotherFunction;
Is there a way to remove listeners from all paths?
source
share