private IEnumerator GameWebConnect() { // 상태 접속중으로 한다 UI_Start.Get().SetTextStatus(Global.g_startStatusConnect); yield return(new WaitForSeconds(0.3f)); #if UNITY_EDITOR #else if (Application.internetReachability == NetworkReachability.NotReachable) { UI_Start.Get().commonMessageBox.Initialize(LocalizationManager.GetLangDesc("Option_Internet"), LocalizationManager.GetLangDesc("Option_Internetconfirm"), LocalizationManager.GetLangDesc("Option_Quit"), null, () => { Application.Quit(); }, false); yield break; } #endif // 서버 접속이 끝난후 버전 체크를 한다 GetState <GameStateStart>().SetStartState(Global.E_STARTSTEP.START_VERSION); }
private IEnumerator GameVersionCheck() { // 상태 버전 체크중.. UI_Start.Get().SetTextStatus(Global.g_startStatusVersionCheck); yield return(new WaitForSeconds(0.3f)); // 버전 체크후 데이터 다운 및 로딩 GetState <GameStateStart>().SetStartState(Global.E_STARTSTEP.START_DATADOWN); }
public void Login() { if (!Social.localUser.authenticated) // 로그인 되어 있지 않다면 { Social.localUser.Authenticate((bool success, string error) => // 로그인 시도 { UI_Start.Get().btn_GuestAccount.gameObject.SetActive(false); UI_Start.Get().btn_GooglePlay.gameObject.SetActive(false); UI_Start.Get().btn_GameCenter.gameObject.SetActive(false); if (success) // 성공하면 { #if UNITY_EDITOR type = EPlatformType.Guest; #elif UNITY_ANDROID type = EPlatformType.Android; #elif UNITY_IOS type = EPlatformType.IOS; #endif StartCoroutine(LoginCoroutine(true)); } else // 실패하면 { Debug.Log("Login Error : " + error); UI_Start.Get().btn_GuestAccount.gameObject.SetActive(true); #if UNITY_ANDROID UI_Start.Get().btn_GooglePlay.gameObject.SetActive(true); #elif UNITY_IOS UI_Start.Get().btn_GameCenter.gameObject.SetActive(true); #endif } }); } else { UI_Start.Get().btn_GuestAccount.gameObject.SetActive(false); UI_Start.Get().btn_GooglePlay.gameObject.SetActive(false); UI_Start.Get().btn_GameCenter.gameObject.SetActive(false); StartCoroutine(LoginCoroutine(true)); } }
private IEnumerator GameDataDownLoad() { // 상태 데이터 다운중 UI_Start.Get().SetTextStatus(Global.g_startStatusDataDown); yield return(new WaitForSeconds(0.3f)); // game data patch download DataPatchManager.Get().JsonDownLoad(); // TODO : [개선] 신규 테이블 매니져 초기화 TableManager.Get().Init(Application.persistentDataPath + "/Resources/"); // 상태 데이터 로딩중 yield return(new WaitForSeconds(0.1f)); // 데이터 다운 및 로딩 후 로그인 유저 정보 받아오기 GetState <GameStateStart>().SetStartState(Global.E_STARTSTEP.START_USERDATA); }
private IEnumerator GameUserData() { // 상태 유저 정보 받는중..혹은 로그인중 UI_Start.Get().SetTextStatus(Global.g_startStatusUserData); yield return(new WaitForSeconds(0.1f)); #if NETWORK_ACT if (NetworkManager.Get().IsConnect() == true) { if (NetworkManager.Get().CheckReconnection() == false) { MoveMainScene(); } } else { string id = UserInfoManager.Get().GetUserInfo().platformID; if (string.IsNullOrEmpty(id)) { UI_Start.Get().SetTextStatus(string.Empty); UI_Start.Get().btn_GuestAccount.gameObject.SetActive(true); // UI_Start.Get().btn_GuestAccount.onClick.AddListener(() => // { // UI_Start.Get().btn_GuestAccount.gameObject.SetActive(false); // UI_Start.Get().btn_GooglePlay.gameObject.SetActive(false); // UI_Start.Get().btn_GameCenter.gameObject.SetActive(false); // UI_Start.Get().SetTextStatus(Global.g_startStatusUserData); // // NetworkManager.session.AccountTemplate.AccountLoginReq(NetworkManager.session.HttpClient, string.Empty, (int)EPlatformType.Guest, string.Empty, string.Empty, string.Empty, string.Empty, OnReceiveAccountLoginAck); // }); #if UNITY_EDITOR #elif UNITY_ANDROID UI_Start.Get().btn_GooglePlay.gameObject.SetActive(true); UI_Start.Get().btn_GooglePlay.onClick.AddListener(() => { UI_Start.Get().btn_GuestAccount.gameObject.SetActive(false); UI_Start.Get().btn_GooglePlay.gameObject.SetActive(false); UI_Start.Get().btn_GameCenter.gameObject.SetActive(false); UI_Start.Get().SetTextStatus(Global.g_startStatusUserData); AuthManager.Get().Login(); }); #elif UNITY_IOS UI_Start.Get().btn_GameCenter.gameObject.SetActive(true); UI_Start.Get().btn_GameCenter.onClick.AddListener(() => { UI_Start.Get().btn_GuestAccount.gameObject.SetActive(false); UI_Start.Get().btn_GooglePlay.gameObject.SetActive(false); UI_Start.Get().btn_GameCenter.gameObject.SetActive(false); UI_Start.Get().SetTextStatus(Global.g_startStatusUserData); AuthManager.Get().Login(); }); #endif } else { #if UNITY_EDITOR NetworkManager.session.AccountTemplate.AccountLoginReq(NetworkManager.session.HttpClient, UserInfoManager.Get().GetUserInfo().platformID, (int)EPlatformType.Guest, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, OnReceiveAccountLoginAck); #elif UNITY_ANDROID NetworkManager.session.AccountTemplate.AccountLoginReq(NetworkManager.session.HttpClient, UserInfoManager.Get().GetUserInfo().platformID, ObscuredPrefs.GetInt("PlatformType", (int)EPlatformType.Guest), string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, OnReceiveAccountLoginAck); #elif UNITY_IOS NetworkManager.session.AccountTemplate.AccountLoginReq(NetworkManager.session.HttpClient, UserInfoManager.Get().GetUserInfo().platformID, ObscuredPrefs.GetInt("PlatformType", (int)EPlatformType.Guest), string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, OnReceiveAccountLoginAck); #endif } } #else // 추후 필요에 의해 다른 스텝이 낄경우 스텝 추가 가능 // 유저 정보 까지 받고 다 했으면 다음 씬으로 이동 ChangeScene(Global.E_GAMESTATE.STATE_MAIN); #endif }