Exemple #1
0
    public void SetDisplayName()
    {
        Action <string> processResponse = response =>
        {
            if (response == null)
            {
                return;
            }

            PF_Authentication.UpdateDisplayName(response, result =>
            {
                displayName.text = result.DisplayName;
                PF_PlayerData.accountInfo.TitleInfo.DisplayName = result.DisplayName;
            });
        };

        if (FB.IsLoggedIn)
        {
            UnityAction <string> afterGetFbName = fbName =>
            {
                DialogCanvasController.RequestTextInputPrompt(GlobalStrings.DISPLAY_NAME_PROMPT, GlobalStrings.DISPLAY_NAME_MSG, processResponse, fbName);
            };
            FacebookHelperClass.GetFBUserName(afterGetFbName);
        }
        else
        {
            DialogCanvasController.RequestTextInputPrompt(GlobalStrings.DISPLAY_NAME_PROMPT, GlobalStrings.DISPLAY_NAME_MSG, processResponse);
        }
    }
Exemple #2
0
    public void SetDisplayName()
    {
        Action <string> processResponse = (string response) => {
            if (response != null)
            {
                PF_Authentication.UpdateDisplayName(response, (UpdateUserTitleDisplayNameResult result) =>
                {
                    this.displayName.text = result.DisplayName;
                    PF_PlayerData.accountInfo.TitleInfo.DisplayName = result.DisplayName;
                });
            }
        };

        if (PF_PlayerData.accountInfo.FacebookInfo != null)
        {
            UnityAction <string> afterGetFBName = (string name) =>
            {
                DialogCanvasController.RequestTextInputPrompt(GlobalStrings.DISPLAY_NAME_PROMPT, GlobalStrings.DISPLAY_NAME_MSG, processResponse, name);
            };

            FacebookHelperClass.GetFBUserName(afterGetFBName);
        }
        else
        {
            DialogCanvasController.RequestTextInputPrompt(GlobalStrings.DISPLAY_NAME_PROMPT, GlobalStrings.DISPLAY_NAME_MSG, processResponse);
        }
    }