private void GetData() { string userId = GlobalControl.instance.userId; if (!string.IsNullOrEmpty(userId)) { SaveDataDAO.GetSaveDataByUser(userId) .Then(response => { if (response != null) { saveData = response; continueButton.interactable = true; continueText.color = new Color(1, 1, 1, 1); } else { continueButton.interactable = false; } }).Catch(error => { continueButton.interactable = false; Debug.Log("Something went wrong: " + error); }); } else { continueButton.interactable = false; } }
public void SaveGame() { loadingText.text = "Loading..."; saveButton.SetActive(false); cancelButton.SetActive(false); string userId = GlobalControl.instance.userId; if (!string.IsNullOrEmpty(userId)) { SaveDataDAO.PatchSaveDataForUser(userId) .Then(response => { loadingText.text = "Complete!"; StartCoroutine(WaitToQuit()); }).Catch(error => { loadingText.text = "Something went wrong..."; cancelButton.SetActive(true); }); } else { loadingText.text = "Something went wrong..."; cancelButton.SetActive(true); } }
private void Start() { menuButton.SetActive(false); string userId = GlobalControl.instance.userId; SaveDataDAO.DeleteSaveDataOnUser(userId) .Then(response => { Debug.Log("Save data deleted"); menuButton.SetActive(true); }).Catch(error => { Debug.Log("Something went wrong..."); menuButton.SetActive(true); }).Finally(() => { menuButton.SetActive(true); }); }