private void HandleDown(InputDriver sender) { //nudge - should initiate dragging if we aren't already doing so: if (Status == PointerStatus.Selecting || Status == PointerStatus.Dragging) { if (!_dragging) { StartDrag(); } //pull distance in: _currentNudge -= _nudgeAmount; //clamp: if (_currentDistance + _currentNudge < minDistance) { _currentNudge = minDistance - _currentDistance; } } if (Target != null || Status == PointerStatus.Dragging) { //interactions: _targetedInputReceiver?.DownReceived(gameObject); } }
private void HandleFire0Up(InputDriver input) { if (_draggedReceivers.Count > 0) { foreach (var item in _draggedReceivers) { item.DragEnd(gameObject); } _draggedReceivers.Clear(); } else { foreach (var item in _selectedReceivers) { item.Clicked(gameObject); } } foreach (var item in _selectedReceivers) { item.Fire0UpReceived(gameObject); if (!_targetedReceivers.Contains(item)) { item.TargetExit(gameObject); } } _selectedReceivers.Clear(); }
private void HandleFire2Up(InputDriver sender) { if (Target != null || Status == PointerStatus.Dragging) { //interactions: _targetedInputReceiver?.Fire2UpReceived(gameObject); } }
private void HandleRotate(float angleDelta, InputDriver sender) { if (Target != null || Status == PointerStatus.Dragging) { //interactions: _targetedInputReceiver?.RadialDragReceived(angleDelta, gameObject); } }
private void HandleDeactivate(InputDriver sender) { //hide renderers: foreach (var item in GetComponentsInChildren <Renderer>()) { item.enabled = false; } }
//Event Handlers: private void HandleActivate(InputDriver sender) { //show renderers: foreach (var item in GetComponentsInChildren <Renderer>()) { item.enabled = true; } }
//Init: private void Reset() { //sets: layermask = -1; //refs: inputDriver = GetComponent <InputDriver>(); }
private void HandleFire2Up(InputDriver input) { if (_targetedReceivers.Count > 0) { foreach (var item in _targetedReceivers) { item.Fire2UpReceived(gameObject); } } }
private void HandleRotate(float delta, InputDriver input) { if (_targetedReceivers.Count > 0) { foreach (var item in _targetedReceivers) { item.RadialDragReceived(delta, gameObject); } } }
private void HandleFire0Up(InputDriver sender) { if (Target != null) { //status: Status = PointerStatus.Targeting; //interactions: _targetedInputReceiver?.Fire0UpReceived(gameObject); } StopDrag(); }
private void HandleFire0Down(InputDriver input) { if (_targetedReceivers.Count > 0) { foreach (var item in _targetedReceivers) { _selectedReceivers.Add(item); item.Fire0DownReceived(gameObject); } _selectedPosition = inputDriver.motionSource.position; _selectedRotation = inputDriver.motionSource.rotation; } }
private void HandleFire0Down(InputDriver sender) { if (Target != null) { _lastSelection = Target; //status: Status = PointerStatus.Selecting; //cache where the motion source is for later delta evaluations: _selectedMotionSourceLocation = inputDriver.motionSource.position; _selectedMotionSourceRotation = inputDriver.motionSource.rotation; _selectedMotionSourceDistanceToHead = Vector3.Distance(_mainCamera.transform.position, inputDriver.motionSource.position); //interactions: _targetedInputReceiver.Fire0DownReceived(gameObject); } }