void GetCollaborationUnlocks() { FirebaseCommunicator.instance.GetObject(referenceName, task => { if (task.IsFaulted) { Debug.LogError("Failed to get collaborations! message: " + task.Exception.Message); return; } else if (task.IsCompleted) { string json = task.Result.GetRawJsonValue(); if (string.IsNullOrEmpty(json)) { unlocks = new CollaborationUnlocks(true, false, false, false, false); UpdateCollaborationUnlocks(); } else { unlocks = JsonConvert.DeserializeObject <CollaborationUnlocks>(json); } } }); }
public void UnlockCollaboration(bool dailyQuest, bool disease, bool oracle, bool kingOffering, bool secretDoor) { unlocks = new CollaborationUnlocks( unlocks.dailyQuest || dailyQuest, unlocks.disease || disease, unlocks.oracle || oracle, unlocks.kingOffering || kingOffering, unlocks.secretDoor || secretDoor ); UpdateCollaborationUnlocks(); }