Right now when using UIButtonKeys if I press the B button on my Xbox 360 controller, the current selection is deselected, butten there is no way for me to get it back. It is just deselected forever apparently.
I would like to customize how NGUI handles the B button by telling it which menu to go back to, or to not do anything at all and maintain the current selection. How would I do this? At the moment I can't find the code where the B button triggers this.
Edit: I ended up going into the UICamera class and commenting out lines 922 and 928 so they looked like the following:
// Clear the selection on the cancel key, but only if mouse input is allowed
if (useMouse && mCurrentSelection != null)
{
if (cancelKey0 != KeyCode.None && Input.GetKeyDown(cancelKey0))
{
currentScheme = ControlScheme.Controller;
currentKey = cancelKey0;
//selectedObject = null; // Mike: Commented out so it doesn't screw up targeting
}
else if (cancelKey1 != KeyCode.None && Input.GetKeyDown(cancelKey1))
{
currentScheme = ControlScheme.Controller;
currentKey = cancelKey1;
//selectedObject = null; // Mike: Commented out so it doesn't screw up targeting
}
}
This seems to be the only way to handle it that I saw. Perhaps the whole section could be commented out, but I didn't want to spend much time testing out what happens when commenting out large code chunks. If anyone knows a better way to handle this please let me know~