Exemplo n.º 1
0
 void uSlots()
 {
     Vector2Int[] slots = inv.GetSlots();
     for (int i = 0; i < slots.Length; i++)
     {
         SetItem(slots[i], slotsContainer.GetChild(i));
     }
 }
Exemplo n.º 2
0
    public void save()
    {
        int parent = -1;

        if (player.transform != null)
        {
            parent = saveOtherStuff.transforms.IndexOf(player.transform.parent);
        }

        SaveDataPlayer sDP = new SaveDataPlayer(inventory.GetSlots(), inventory.GetTools(), inventory.GetActives(), player.position, player.velocity, player.rotation, parent, inventory.money);

        SaveSystem.SavePlayer(sDP, saveCom.saveName);
    }
Exemplo n.º 3
0
 void loadInventory()
 {
     Vector2Int[] invSlots = inv.GetSlots();
     foreach (Transform child in productPanel)
     {
         Destroy(child.gameObject);
     }
     for (int i = 0; i < invSlots.Length; i++)
     {
         GameObject  g  = GameObject.Instantiate(prefab, Vector2.zero, Quaternion.identity, productPanel);
         shopProduct sP = g.GetComponent <shopProduct>();
         sP.slot = i;
         sP.setVariables(items.instance.itemObjects[invSlots[i].x], false, invSlots[i].y);
     }
 }