Пример #1
0
    void LoginWithUserState()
    {
        string playerPrefs_login = PlayerPrefs.GetString("Login", "none");


        //스마일게이트 제출용
        //string playerPrefs_login = PlayerPrefs.GetString("Login", "guest");
        //PlayerPrefs.SetString("nickname", "스마게");
        //PlayerPrefs.SetInt("tutorial", 7);
        //


        if (playerPrefs_login == "none")//계정 생성하지 않았으면
        {
            //facebook_login_button.gameObject.SetActive(true);
            guest_login_button.gameObject.SetActive(true);
        }
        else if (playerPrefs_login == "facebook")
        {
            Debug.Log("facebook login");
            xmlManager.Count_LogOut_Time();

            FB.Init(delegate() {
                if (FB.IsLoggedIn)
                { //User already logged in from a previous session
                    awsManager.AddLogin_To_Credentials(AccessToken.CurrentAccessToken.TokenString);

                    //editormap 빼고 전부 다
                    //LoadUserData();
                    jsonAdapter.GetAllUserData(PlayerPrefs.GetString("nickname", "pingpengboong"), GetWebRequestCallback);
                }
                else
                {
                    Debug.LogError("critical error");
                    //var perms = new List<string>() { "email" };
                    //FB.LogInWithReadPermissions(perms, FacebookNotLoggedInCallback);
                    //Critical Error!
                }
            });
        }
        else if (playerPrefs_login == "guest")
        {
            Debug.Log("Hi " + PlayerPrefs.GetString("nickname", "pingpengboong") + "Guest Login");
            //LoadUserData();
            jsonAdapter.GetAllUserData(PlayerPrefs.GetString("nickname", "pingpengboong"), GetWebRequestCallback);
        }
        else
        {
            Debug.LogWarning("login error");
        }
    }