I'm struggling with UI! What I aim to do is make a horizontal layout of icon buttons that, when clicked, start a building-placement mechanic (like a real-time strategy game). Each icon button represents a different building (e.g. castle, barracks, tower).
I've read the UI sections of ORK3 and Makinom2 guides, but still don't understand how to make a layout of icon buttons that do stuff when clicked. I don't even really know the difference between a UI box and a HUD, and which to use as the starting point for the prefab. They both seem to have some button functionality, but each seems to have something I want. Like, the Control HUD section has options for selecting a layout, but the UI box doesn't. But the UI box "choice button" option comes with the "button" component on it, which has the "On Click ()" function, that the HUD doesn't.
The button's "On Click ()" tool-tip says it fires an event when the mouse button is released while hovering over the UI button, but will not fire if you drag your cursor off of the UI element. That is exactly what I want for those buttons. Also, I wouldn't mind being able to change a variable or fire a schematic when I mouse over the icon button, before pressing the mouse button. There seems to be options in various places for firing schematics when a UI box or HUD is "focused"....is that the same as "highlighted" in the button component, like on mouse-over? What's the difference between highlighted and focused?
I know from my searches that the On Click () button function uses an "animation" machine to work, but I can't find the specific tutorial that covers it in detail, and the short explanation in the guide isn't detailed enough for my non-coder brain to use. Yet I have a specific memory of reading (likely a forum post) the exact details of using a schematic in the On Click () list, but I can't find it. I remember it had a warning not to type spaces in some part of the process. What do I put in the empty object field.....a schematic, an empty game object with the animation machine attached, something else? And where is the "AnimationMachineComponent > UIGameObject (GameObject) function" mentioned in the Guide? I'm lost.
So first, do I pick "HUD Control" or "UI Box Choice Button" from the Makinom/ORK context menu, to start making the icon button prefabs? Then how do I make things happen on mouse-over? Then, how do I make things happen on-click, either with the button "On Click ()" option, or a Makinom-equivalent? If anyone could give me a "for dummies" walkthrough of this, I would be obliged.
The idea would be that when I hover the mouse over an icon-button, a global int variable (lets say "buildingID") would change to reflect the building type represented by the button. If hovering over castle button, buildingID=0 (if tower buildingID = 1, etc.). I could maybe use object variables on each button prefab (can object variables be used on UI elements?) to identify the building. Then, when the button is clicked, another schematic starts which uses the buildingID to determine which building to use and starts the placement process.
Yikes....any help is appreciated!