Hello
Im trying to get this working with equipped items.
I managed to get the list.
But when i try it add the items to equipped list its like they are not removed from normal inventory?
They stay there and now user have 2 times normal items.
this is the code im using to update items as soon as Mainmenu opens up.
GTD_GameData.PlayFabEquippedItems is just a string of items that the users has from Cloud containing this: "Knight Gloves,Knight Helmet,Knight Boots,Knight Armor,Necklace of Destruction"
So to replicate you can use:
GTD_GameData.PlayFabEquippedItems = "Knight Gloves,Knight Helmet,Knight Boots,Knight Armor,Necklace of Destruction"
Its only removing the first item. "Knight Gloves" is being removed. But not rest after that.
Im trying to get this working with equipped items.
I managed to get the list.
But when i try it add the items to equipped list its like they are not removed from normal inventory?
They stay there and now user have 2 times normal items.
C#:
public void AddItemsToEquipped() {
string equippedItems = "";
equippedItems = GTD_GameData.PlayFabEquippedItems;
var ArrEI = equippedItems.Split(","[0]);
for (int i = 0; i < ArrEI.Length; i++)
{
Debug.Log("i: " + i + " testCount: " + ArrEI.Length);
Debug.Log("Equipped: " + ArrEI[i].ToString());
string ItemName = ArrEI[i].ToString();
var myItemDefinition = InventorySystemManager.GetItemDefinition(ItemName);
var myItem = InventorySystemManager.CreateItem(myItemDefinition);
int Amount;
Amount = 1;
var myItemInfo = new ItemInfo((Amount, myItem));
inventory.GetItemCollection("Backpack").RemoveItem(myItemInfo);
inventory.GetItemCollection("Equipped").AddItem(myItemInfo);
}
}
this is the code im using to update items as soon as Mainmenu opens up.
GTD_GameData.PlayFabEquippedItems is just a string of items that the users has from Cloud containing this: "Knight Gloves,Knight Helmet,Knight Boots,Knight Armor,Necklace of Destruction"
So to replicate you can use:
GTD_GameData.PlayFabEquippedItems = "Knight Gloves,Knight Helmet,Knight Boots,Knight Armor,Necklace of Destruction"
Its only removing the first item. "Knight Gloves" is being removed. But not rest after that.