跳转到主要内容

记录分数

记录玩家的分数并注册到排行榜服务。 玩家的分数可能会因控制台中设置的排行榜记录方式不同而有所差异。

调用信息

public void Record (string tableCode, string recordId, double score, string extraData, PlayNANOODelegate callback)

调用详细信息

参数说明类型
tableCode表代码string
recordId记录 ID(例如玩家 ID)string
score记录分数double
extraData附加数据string
callback通信结果PlayNANOODelegate

源代码

using PlayNANOO;

public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;

void Awake()
{
plugin = Plugin.GetInstance();

plugin.LeaderboardManagerV20240301.Record(tableCode, recordId, score, extraData, (status, errorCode, jsonString, values) => {
if (status.Equals(Configure.PN_API_STATE_SUCCESS))
{
Debug.Log("Success");
}
else
{
Debug.Log("Fail");
}
});
}
}

通信结果

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"Status": "success"
}

通信结果详细信息

数据键说明类型
Status处理结果string