When using the following code it returns the error:
"/Object/SetObjects: Invalid input parameters Objects: The field Objects must be a string or array type with a minimum length of '1'."
I am new to PlayFab so I am not sure if I am just missing something here. Looking at the example here it looks to be correct:
https://learn.microsoft.com/en-us/gaming/playfab/features/data/entities/entity-objects
Debugging the 'data' dictionary I confirmed it does have the two entries. However when debugging the 'dataList' it contains zero entries after creating the new SetObject. Is someone able to point me in the right direction as to what I am doing wrong please?
public void SavePlayerData() { var data = new Dictionary<string, object>() { {"Cash", GameManager.instance.cash }, {"Rubies", GameManager.instance.rubies } }; Debug.Log(data.Count); var dataList = new List<SetObject>(); { new SetObject() { ObjectName = "PlayerData", DataObject = data }; }; Debug.Log(dataList.Count); PlayFabDataAPI.SetObjects(new SetObjectsRequest() { Entity = new EntityKey { Id = entityKey.Entity.Id, Type = entityKey.Entity.Type }, Objects = dataList, }, (setResult) => { Debug.Log(setResult.ProfileVersion); }, OnPlayFabError); },
When using the following code it returns the error: "/Object/SetObjects: Invalid input parameters Objects: The field Objects must be a string or array type with a minimum length of '1'." I am new to PlayFab so I am not sure if I am just missing something here. Looking at the example here it looks to be correct: https://learn.microsoft.com/en-us/gaming/playfab/features/data/entities/entity-objects Debugging the 'data' dictionary I confirmed it does have the two entries. However when debugging the 'dataList' it contains zero entries after creating the new SetObject. Is someone able to point me in the right direction as to what I am doing wrong please?
public void SavePlayerData() { var data = new Dictionary<string, object>() { {"Cash", GameManager.instance.cash }, {"Rubies", GameManager.instance.rubies } }; Debug.Log(data.Count); var dataList = new List<SetObject>(); { new SetObject() { ObjectName = "PlayerData", DataObject = data }; }; Debug.Log(dataList.Count); PlayFabDataAPI.SetObjects(new SetObjectsRequest() { Entity = new EntityKey { Id = entityKey.Entity.Id, Type = entityKey.Entity.Type }, Objects = dataList, }, (setResult) => { Debug.Log(setResult.ProfileVersion); }, OnPlayFabError); }