Author Topic: UIKeyNavigation, startSelected, and instantiated buttons  (Read 1888 times)

Fractalbase

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 23
    • View Profile
UIKeyNavigation, startSelected, and instantiated buttons
« on: June 28, 2014, 07:50:13 PM »
I've had trouble getting my screen with a grid of instantiated buttons to work with the selected item (of UIKeyNavigation).  I've somehow gotten that to work, but am not sure now.

My screens have transitions where to move from current menu to a sub menu:
        subMenu.SetActive(true);
        currentMenu.SetActive(false);

This works well and traverses to the sub menu.

On the menus, there is a back button.  Clicking the back button has an effect like this:
        superMenu.SetActive(true);
        currentMenu.SetActive(false);

The difficulty is, while the first encountering of a menu with a grid of instantiated items has the startSelected set and works, whenever returning to that menu, nothing is selected.

Any ideas why?

thanks,
fb



Fractalbase

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 23
    • View Profile
Re: UIKeyNavigation, startSelected, and instantiated buttons
« Reply #1 on: June 29, 2014, 10:26:31 AM »
I figured out my issue.  Just use "UICamera.selectedObject", and Implement "OnEnabled()".