ok, i'm having issues with an inventory system I'm working on.
What I would like to do is have a two part inventory.
1. A scrolling view port on the right side. (working)
2. A detail of inventory on the left. This is composed of a larger image area and a text label.
The idea is that the player will tap on the inventory item and then that would fill the left image and label. Also the inventory tapped will have a highlight(lower priority
But I can't seem to figure a way to do this. I've tried a few things out, but I'm just not familiar enough to figure this out. Where would I start looking to be able to do this?
Comments
Open up the Inventory Manager and click on the Properties sub-tab. From there, create a new Property, name it Description and give it the type String. Going back to the Items tab, you'll see that you can then enter in a description for each item.
How to use these properties? The Scripting Guide shows that the InvItem class has a GetProperty function, and you can find out the last-clicked item with the RuntimeInventory class's selectedItem variable.
So, you're going to want something like this in a C# Update() function:
AC.InvItem selectedItem = AC.KickStarter.runtimeInventory.selectedItem;
if (seletedItem != null)
{
string description = selectedItem.GetProperty (0).GetValue ();
// Assign the description to the UI text-box
}
That said, I downloaded the prefab, and assigned the Canvas + 3 inventory buttons in the Menu Manager. Dragging-and-dropping worked fine, so it could well be that the problem lies in whatever custom code you have. I'd recommend doing the same (ie. stripping anything custom) and checking that AC behaves correctly before adding anything custom.
I'm currently just trying to get the inventory item properties to show in the inspector after being clicked (e.g. item has been given weight / cost / size type properties).
Anyway, this thread has already been helpful so thank you!