void CheckController() { if (!isController) { joystick = InputManager.ActiveDevice; if (joystick != null && joystick.Name != "NullInputDevice" && joystick.Name != "Unknown Device") { isController = true; selected = item[index]; selected.Select(); Cursor.visible = false; raycaster.enabled = false; } } else { joystick = InputManager.ActiveDevice; if (joystick == null || joystick.Name == "NullInputDevice" || joystick.Name == "Unknown Device") { isController = false; selected.Diselect(); Cursor.visible = true; raycaster.enabled = true; } } }
private void OnEnable() { if (isController) { index = 0; selected = item[index]; selected.Select(); } else { Cursor.visible = true; } }
void SelectItem() { selected.Diselect(); selected = item[index]; selected.Select(); }