這是改姓名的函式
public async Task<bool> UpdateUserDataAsync(
string email,
string playerName)
{
try
{
var result = await LCUtil.CallRPC(LCConstants.EP_UpdateUserData, new Dictionary<string, object>()
{
{ LCConstants.Field_email, email },
{ LCConstants.Field_playerName, playerName }
});
return (bool)result;
}
catch (Exception e)
{
Debug.Log(e.ToString());
}
return false;
}
RPC的部分大家都是共用一個Util class所提供的靜態函式
public static async Task<object> CallRPC(string rpcName, object param)
{
try
{
return await LCCloud.RPC(rpcName, param);
}
catch (Exception e)
{
Debug.Log(e.ToString());
}
return null;
}