void GetAdventurerQuest() { FirebaseCommunicator.instance.GetObject(adventurerReferenceName, (task) => { if (task.IsFaulted) { Debug.LogError("Failed to get adventurer quest"); return; } else if (task.IsCompleted) { string json = task.Result.GetRawJsonValue(); if (string.IsNullOrEmpty(json)) { Debug.LogWarning("No adventurer quest exists"); adventurerQuest = null; } else { adventurerQuest = JsonConvert.DeserializeObject <AdventurerQuest>(json); } } }); }
void SetAdventurerQuestListener() { FirebaseCommunicator.instance.SetupListenForValueChangedEvents(adventurerReferenceName, (obj, args) => { string json = args.Snapshot.GetRawJsonValue(); if (string.IsNullOrEmpty(json)) { Debug.LogWarning("No adventurer quest exists"); adventurerQuest = null; } else { adventurerQuest = JsonConvert.DeserializeObject <AdventurerQuest>(json); } }); }