private void CheckAutoLogin() { StopCoroutine(FirstSceneCheck()); // TODO : 여기 아래에 ! 붙여야함 if (!PlayerPrefs.HasKey("SavedLoginInSettings")) { StartCoroutine(ChangeScene(1)); } else { DataManager.instance.OnLoadingImage += onLoadingImage; string loadData = PlayerPrefs.GetString("SavedLoginInSettings"); LogInSettingsOption logInSettingsOption = JsonUtility.FromJson <LogInSettingsOption>(loadData); if (logInSettingsOption.isAutoLogIn) { string loadLoginData = PlayerPrefs.GetString("SavedLoginInform"); LogInInform logInInform = JsonUtility.FromJson <LogInInform>(loadLoginData); DataManager.instance.SendSignIn(logInInform.Id, logInInform.Pw); } else { StartCoroutine(ChangeScene(1)); } } }
//Toggle 설정 저장 private void SaveLoginSettings() { logInSettingsOption = new LogInSettingsOption(); logInSettingsOption.isAutoLogIn = autoLogin.isOn; logInSettingsOption.isSetID = autoSetId.isOn; string jsonData = JsonUtility.ToJson(logInSettingsOption, true); PlayerPrefs.SetString("SavedLoginInSettings", jsonData); }
//저장된 데이터 유무 확인 private bool LoadSettings() { if (!PlayerPrefs.HasKey("SavedLoginInSettings")) { return(false); } else { //저장된 값을 파싱해 logInSettingsOption 객체에 담는다. string loadData = PlayerPrefs.GetString("SavedLoginInSettings"); logInSettingsOption = JsonUtility.FromJson <LogInSettingsOption>(loadData); return(true); } }
public void OnPressLogOutButton() { string loadData = PlayerPrefs.GetString("SavedLoginInSettings"); LogInSettingsOption logInSettingsOption = JsonUtility.FromJson <LogInSettingsOption>(loadData); if (logInSettingsOption.isAutoLogIn) { PlayerPrefs.DeleteKey("SavedLoginInSettings"); logInSettingsOption.isAutoLogIn = false; string jsonData = JsonUtility.ToJson(logInSettingsOption, true); PlayerPrefs.SetString("SavedLoginInSettings", jsonData); StartCoroutine(GameSceneManager.instance.ChangeScene(1)); } else { StartCoroutine(GameSceneManager.instance.ChangeScene(1)); } }