3
« on: November 13, 2015, 12:49:09 AM »
Yep! I've tried this and have tried to set the UICamera.selectedObject to the button in that direction.
Here's a couple of ways I've tried and what's happened
( I should mention that I had to move away from the regular vector checks in the input, because there were way too many conflicts between buttons. The North, East, South, Western buttons were able to be selected but anything on a diagonal direction wouldn't select)
- I've set the direction of the joystick to spit out an 'angle' of direction (converted to a float), So when there is input and the direction is between -25 and 25, set the UICamera.selectedObject the the Item button (northern button). When this value is between 35 and 65, set the selected Object to the Equip Button (NorthEastern button). This way makes nothing selected at all. So I went and tried...
- Using the same method above, I've set the UICamera.hoveredObject to each button in question, the line directly after sets the UICamera.selectedObject to the currently hovered button.
Now THIS kind of works, it's hovers over onto and between the Item and Equip buttons absolutely fine, the problem is that the Item button has the selectedObject focus and the Equip button never has the selectedObject focus.
I've also popped in bool checks to execute said code when either is true (if itemhighlighted is true then call the ItemHighlighted function and select that button, same with the equip button) and those seem to be working correctly.
In other words, is there any trickery I should be looking out for when using and populating UICamera.selectedObject?