Horje
iterate though data in firebase unity Code Example
iterate though data in firebase unity
public void GetUsers(List<User> users)
{
        FirebaseDatabase.DefaultInstance
  .GetReference("users")
        .GetValueAsync().ContinueWith(task =>
         {
                 if (task.IsFaulted) {
      // Handle the error...
                    Debug.Log("Error was:"+task.Exception.Message);
                    Debug.LogError("Error was:"+task.Result.Children);
            }
            else if (task.IsCompleted) {
            DataSnapshot snapshot = task.Result;
            // Do something with snapshot...
                        foreach(DataSnapshot s in snapshot.Children){
                        IDictionary dictUsers = (IDictionary)s.Value;   
                        Debug.Log(dictUsers["displayName"]);                    
                    }   
                    // After this foreach loop in snapshot.Children, nothing executes
                    UIManager.instance.ShowOtherUsers();
            }
  });
}




Csharp

Related
get local position unity Code Example get local position unity Code Example
C Sharp List Code Example C Sharp List Code Example
c# check multiple variables for null Code Example c# check multiple variables for null Code Example
cluster size C:\ powerschell Code Example cluster size C:\ powerschell Code Example
trhow exception if is null c# Code Example trhow exception if is null c# Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11