private void DropController() { HandleType lastHandleType = currentHandleType; currentPointer = null; currentHandleType = HandleType.None; ResetVisuals(); if (lastHandleType == HandleType.Scale) { if (debugText != null) { debugText.text = "OnPointerUp:ScaleStopped"; } ScaleStopped?.Invoke(); } else if (lastHandleType == HandleType.Rotation) { if (debugText != null) { debugText.text = "OnPointerUp:RotateStopped"; } RotateStopped?.Invoke(); } }
public void OnSourceLost(SourceStateEventData eventData) { sourcesDetected.Remove(eventData.Controller); if (currentPointer != null && currentPointer.InputSourceParent.SourceId == eventData.SourceId) { HandleType lastHandleType = currentHandleType; currentPointer = null; currentHandleType = HandleType.None; // todo: move this out? ResetVisuals(); if (lastHandleType == HandleType.Scale) { if (debugText != null) { debugText.text = "OnSourceLost:ScaleStopped"; } ScaleStopped?.Invoke(); } else if (lastHandleType == HandleType.Rotation) { if (debugText != null) { debugText.text = "OnSourceLost:RotateStopped"; } RotateStopped?.Invoke(); } } }