// Update is called once per frame void Update() { handIndicator = MyInputManager.HoveredByRayInteractor(_col); if (handIndicator != '0') { _outline.enabled = true; _selected = true; if (MyInputManager.TriggerValue(handIndicator) <= 0) { _triggerPressed = false; } Debug.Log(!_triggerPressed + "," + (MyInputManager.TriggerValue(handIndicator) > 0) + "," + _selected); if (!_triggerPressed && (MyInputManager.TriggerValue(handIndicator) > 0) && _selected) { _triggerPressed = true; if (!_rotated) { _animator.Play(closeAnim); _rotated = true; } if (_rotated) { _animator.Play(openAnim); _rotated = false; } } } else { _outline.enabled = false; _selected = false; } }
private void Update() { if (listenForRaycast) { handIndicator = MyInputManager.HoveredByRayInteractor(_collider); } if (listenForRaycast && handIndicator == '0') { handIndicator = MyInputManager.InRange(transform.position, grabbingRange); } if (!listenForRaycast) { handIndicator = MyInputManager.InRange(transform.position, grabbingRange); } if (handIndicator != '0') { Select(true); } else { Select(false); } }