i think unity assign automatically the stick to the same of this axis

Code: Select all
if(UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject == this.gameObject)
{
if (Input.GetKeyDown(keySelect) || (!string.IsNullOrEmpty(buttonNameSelect) && Input.GetButtonDown(buttonNameSelect))) {
var pointer = new PointerEventData(EventSystem.current);
ExecuteEvents.Execute(button.gameObject, pointer, ExecuteEvents.submitHandler);
}
//HACK
if (Input.GetKeyDown(keyUp) || (!string.IsNullOrEmpty(buttonNameUp) && Input.GetButtonDown(buttonNameUp))) {
StartCoroutine(SetSelectedGameObject(nav.selectOnUp.gameObject));
}
if (Input.GetKeyDown(keyDown) || (!string.IsNullOrEmpty(buttonNameDown) && Input.GetButtonDown(buttonNameDown))) {
StartCoroutine(SetSelectedGameObject(nav.selectOnDown.gameObject));
}
}