I am using Inventory v2 and I have Items on my Inventory. However couldn't get the list of it. It returns nothing.
public List<ItemInstance> Inventory;
public void Start()
{
if (string.IsNullOrEmpty(PlayFabSettings.staticSettings.TitleId))
{
PlayFabSettings.staticSettings.TitleId = "*****";
}
var request = new LoginWithCustomIDRequest { CustomId = "Temurlogin", CreateAccount = true };
PlayFabClientAPI.LoginWithCustomID(request, OnLoginSuccess, OnLoginFailure);
}
private void OnLoginSuccess(PlayFab.ClientModels.LoginResult result)
{
getInventory();
}
private void getInventory()
{
PlayFabClientAPI.GetUserInventory(new GetUserInventoryRequest(), result =>
{
foreach (var item in result.Inventory)
{
Debug.Log(item.DisplayName + ":" + item.CatalogVersion);
Inventory.Add(item);
}
}, error =>
{
Debug.LogError(error.GenerateErrorReport());
});
}