question

akshay sharma avatar image
akshay sharma asked

error CS1503: Argument 3: cannot convert from 'method group' to 'Action'

using System;
using System.Collections.Generic;
using PlayFab;
using PlayFab.ClientModels;
using UnityEngine;
using UnityEngine.UI;


public class PlayfabDisplayName : MonoBehaviour
{
    public InputField nameInput;

    void Login()
    {
        var request = new LoginWithCustomIDRequest{
            CustomId = "PlayerName",
            CreateAccount = true,
            InfoRequestParameters = new GetPlayerCombinedInfoRequestParams{
                GetPlayerProfile = true
            }
        };
        PlayFabClientAPI.LoginWithCustomID( request ,OnLoginSuccess,OnError);

    }

    void OnLoginSuccess(LoginResult result)
    {
        Debug.Log("Sucessful Login");
        string name = null;
        if (result.InfoResultPayload.PlayerProfile!=null)
             name = result.InfoResultPayload.PlayerProfile.DisplayName;
           
    }

    public void SubmitNameButton()
    {
        var request = new UpdateUserTitleDisplayNameRequest {
            DisplayName = nameInput.text,
        };
        PlayFabClientAPI.UpdateUserTitleDisplayName (request, OnDisplayNameUpdate,OnError);

    }

    void OnDisplayNameUpdate(UpdateUserTitleDisplayNameResult result)
    {
  
    }

    void OnError() {

    }

    
}


unity3d
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Ivan Cai avatar image
Ivan Cai answered

In your case, modify the code as follows:

void OnError()
{
}

Edit to:

void OnError(PlayFabError error)
{
}

In our Unity SDK, when we call your error callback, we pass a PlayFabError which contains all the information on the error that occurred. So, PlayFabError is indispensable.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.