/// <summary> /// Update interactor location and act on events /// </summary> public void Update() { foreach (Transform menuItem in _menuItems) { var interactorId = menuItem.name; // Update location var interactor = _eyeXHost.GetInteractor(interactorId); interactor.Location = CreateLocation(menuItem, _gameMenu.IsVisible); // Check if activated if (interactor.IsActivated()) { HandleActivation(interactorId); } // Check if focus has changed var activationFocusState = interactor.GetActivationFocusState(); if (activationFocusState == ActivationFocusState.HasActivationFocus || activationFocusState == ActivationFocusState.HasTentativeActivationFocus) { HighlightMenuItem(menuItem); } else { RestoreMenuItem(menuItem); } // Manually bind the Right Shift key to trigger an activation mode on, on key down if (Input.GetKeyDown(KeyCode.RightShift)) { _eyeXHost.TriggerActivationModeOn(); } // Manually bind the Right Shift key to trigger an activation, on key up if (Input.GetKeyUp(KeyCode.RightShift)) { _eyeXHost.TriggerActivation(); } } }
private void Update() { // Update the camera position. UpdateCamera(); // Update the missile target indicator. UpdateMissileTargetIndicator(); // Update weapon input. UpdateWeaponInput(); // Not enough enemies left? if (_enemies.Count < 2) { SpawnNewEnemies(); } if (Input.GetKeyDown(KeyCode.Space)) { _eyexHost.TriggerActivation(); } }