0
Not a bug

How to Customize Inventory Skin

Cr4shBarcode 6 months ago in Inventory updated by Marti (Lead Developer) 6 months ago 2

This may not be a "bug", per se, but I still need to know how to fix this:

I have a custom skin made from a duplicate of the default Adventure Inventory skin. I've been wanting to change it so that the names of the inventory items pop up as text beneath the whole menu instead of in little orange bubbles that the text won't fit in. Today I decided to do it, even though from experience, making too many changes inside the inventory prefab at one time makes things stop working properly.

I switched to a practice duplicate of the Adventure Inventory skin. I found the ItemInfo object inside the ItemAdventure prefab, copied it, and pasted it in my preferred place inside the practice skin. It didn't appear when I tested it on play, so I restarted the scene to discard changes and start over. 


It looks like the prefabs have saved my changes automatically, so I tried to put things back the way they were manually. The thing is, the ItemInfo no longer appears during play no matter what I do. I also noticed that the object box in the ItemInfo Inspector is now white instead of blue. I think this means it's disabled.

1) How can I get the ItemInfo to appear again without re-importing GC (I don't want to mess with all the Inventory already worked into my game)

2) How can I achieve what I wanted, which was to have the ItemInfo appear beneath the menu instead of on the top of the items?

Unity version:
Game Creator version:
Latest

Answer

Answer
Not a bug

The blue icon means it's a prefab root object. A white one means it s a normal game object. An Inventory skin is composed of two prefabs:

  • The Inventory UI
  • The Item UI

The first one is the UI you see when you open the inventory. The Item UI is a prefab that adapts to the item type you want to display. If you have two items: a potion and a sword in your inventory, two instances of these prefabs will be instantiated inside the Inventory UI's content field.

Having this in mind, to customize the Item UI, you can drag it inside the Inventory UI, make the changes you want, but then, you need to save it back to the Item UI prefab (by dragging and dropping it) and also remove it from the Inventory UI prefab.


Your Item UI, in play mode, disappears because as soon as you start, the Inventory UI clears any child objects from its "content" field, where the Item UI instances will be placed.


Hope this helps!

Answer
Not a bug

The blue icon means it's a prefab root object. A white one means it s a normal game object. An Inventory skin is composed of two prefabs:

  • The Inventory UI
  • The Item UI

The first one is the UI you see when you open the inventory. The Item UI is a prefab that adapts to the item type you want to display. If you have two items: a potion and a sword in your inventory, two instances of these prefabs will be instantiated inside the Inventory UI's content field.

Having this in mind, to customize the Item UI, you can drag it inside the Inventory UI, make the changes you want, but then, you need to save it back to the Item UI prefab (by dragging and dropping it) and also remove it from the Inventory UI prefab.


Your Item UI, in play mode, disappears because as soon as you start, the Inventory UI clears any child objects from its "content" field, where the Item UI instances will be placed.


Hope this helps!