Hi everyone!
Sorry for the noob question but how do you change the visibility property of an inventory box via scripting?
Thing is, I had just made a Unity UI menu which simulated tabs. It had the ability to move between the "inventory boxes" inside the menu (which were gameobjects with canvas grids and 8 child button/slots), by pressing the left and right keys(for keyboard and controller scheme). Took me a couple of hours to get it to work perfectly (navigation looped perfectly, even from the first and last element)...it took into account the available "inventoryboxes" in the menu by way of exposed arrays, meaning I could use the same scrip for as many "inventoryboxes" as I wanted and it would remain automatic (good because I'll have a lot of tabbed-like menus)... but when I went to connect it to AC, I found, to my dismay, that AC uses the button slots of a single canvas grid for all inventory boxes in the same menu... So, I have to redo the script...
I originally was Enabling and Disabling the inventory boxes (gameobjects) and changing the First Selected on the fly to create the effect, now by what I see, I'll have to change the visibility property of the inventory box. Ive seen it as an action in cut scenes and action lists, but I'm not sure how to do it in scripting. I'll probably have to discard the idea of a reusable script, too, cause I'm guessing you have to enter the specific name of the menu before changing the visibility?
Anyway, as usual, any advice will be greatly appreciated here.
Comments
AC.KickStarter.playerMenus.RecalculateAll ();
Alternatively, you can do this with an ActionList asset, and run the asset file by calling it's Interact() function.