批量保存数据
安全保存玩家/游戏环境信息数据。 已保存的游戏数据可在控制台中查询,还可通过数据追踪查看历史数据保存记录。
调用信息
public void MultiSave (MultiSaveParam storageItems, PlayNANOODelegate callback) {}
调用详细信息
| 参数 | 说明 | 类型 |
|---|---|---|
| storageItems | 玩家数据保存列表 | MultiSaveParam |
| callback | 通信结果 | PlayNANOODelegate |
源代码
using PlayNANOO;
public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;
void Awake()
{
plugin = Plugin.GetInstance();
PlayNANOO.Storage.MultiSaveParam multiSaveParam = new PlayNANOO.Storage.MultiSaveParam();
multiSaveParam.Items.Add(new PlayNANOO.Storage.MultiSaveParamValue { StorageKey = "Storage1", StorageValue = "StorageValue1", IsPrivate = true });
multiSaveParam.Items.Add(new PlayNANOO.Storage.MultiSaveParamValue { StorageKey = "Storage2", StorageValue = "StorageValue2", IsPrivate = false });
plugin.Storage.MultiSave(multiSaveParam, (status, error, 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" : "String"
}