Hello to all!
I'm trying a little "animation" in which, whenever an item is picked up, the menu pops open, and the item appears in the menu, it highlights, and then the menu closes.
It all works flawlesly except the hightlight.
Before delving into details, I'm using AC version 1.57 and Unity version 5.5.1f1 Personal 64bits.
My Inventory menu is an AC menu, and the items are displayed using a InventoryBox. every inventory item has both a main and an active graphic (the active graphic being a PNG with a modified saturation on photoshop)
My ActionList follows the following steps: It opens the menu (Menu: Change State), adds the item (Inventory: Add or Remove), makes the object invisible so that it doesn't show on the stage anymore (Object: Visibility), disables the hotspot (Hotspot: Enable or Disable), and finally, closes the menu (Menu: Change State).
I'm calling the hightlight right after making the object invisible on the stage. The item appears alright in the menu, but it never highlights.
I'm calling Object: Highlight: Enable (inventory item), making it pulse continously, then Engine: Wait for a few seconds, and then disabling the highlight. (I have also tried just making it pulse without calling enable first, but it did not work).
What could I be doing wrong?
Thanks in advance!
Comments
Try it with the Demo managers so we can see if it's an issue with your own. Just assign the Managers and create a new scene with a simple OnStart Cutscene that adds the "Prop sword" item and highlights it. Set the Cutscene's When running field to Run In Background so that you can access the Menu while it runs, and see if it works then.
Yes - you can get the item's slot directly from the MenuInventoryBox element:
MenuInventoryBox inventoryBox = AC.PlayerMenus.GetElementWithName ("MyInventoryMenu", "MyInventoryBox") as MenuInventoryBox;
int slot = inventoryBox.GetItemSlot (KickStarter.runtimeInventory.SelectedItem.id);
UISlot selectedSlot = inventoryBox.uiSlots [slot];
RectTransform rectTransform = selectedSlot.GetRectTransform ();
thanks