Hey fellow Uniters,
So I’ve got a predicament here that many others seem to have; however, I’ve tested every solution from each search result to no avail! I’ve racked my brain/the internet for days as to a possible solution, but have none - hence my question here.
I’ve got a basic working Main Menu. I created a string array for the menu options, assign names to the options in the inspector, and then create a for (each item in the string array) - loop to create buttons. Looks alright. I’ve even got a custom GUIskin assigned that changes text color/texture of the focused option, so I can tell which menu option I’m currently on. (I opted for the “For loop” for my buttons as opposed to a “Selection Grid,” as the latter of the two is far less customizable). This is all navigable by keyboard - I can key up/down and pick an option and I’d like to keep it that way. I have the GUI.SetNextControlName within the for loop, and a GUI.FocusControl after my selection code, although I’m not really sure they do anything or how they work. But here’s where my real problem lies - animation.
How can I access the focused menu option through scripting in order to animate it (I’d be using iTween, because…well, if you haven’t used it yet, use it!)? I’ve seen a few people put their button specifications within an “If” statement; however, that appears to only be useful for single button creation. I haven’t seen it done in a “for - loop” button creation system. I’d simply like to access the menu item that has keyboard focus and scale it to be just a tad bigger, but GUIskin only offers parameters for texture and text.
Once I’ve established a working animation for each icon, how can I completely eliminate the mouse functions? I would like the mouse to NOT affect the menu whatsoever. That means the GUIskin does not react to mouse hovers or clicks. Since the GUIskin does not appear to have a disable function for those, should I eliminate the GUIskin altogether and assign textures via scripting? If I do that, how could I access the highlighted option (focused, but not yet pressed/activated) in order to change texture, text color, and animate?
Submenus. I’m not sure where to start with this, so I’ll more than likely make another post. But while we’re on the topic - what’s the best way of creating a submenu? The only way I’ve seen it done is enumeration. I have not yet tried anything yet, but I really don’t want to dive into it and become even more irritated with Unity’s current GUI system. But it’s nice to know in advance for planning purposes
Thank you in advance!