public void Cancel() { if (mAgent.visible) { mAgent.StopDrag(); mAgent.visible = false; } }
private void DragBegin(int touchId) { if (sDragging != null) { sDragging.StopDrag(); } _dragTouchId = touchId; sGlobalDragStart = Stage.inst.GetTouchPosition(touchId); sGlobalRect = this.LocalToGlobal(new Rect(0, 0, this.width, this.height)); sDragging = this; Stage.inst.onTouchEnd.Add(__touchEnd2); Stage.inst.onTouchMove.Add(__touchMove2); }
private void DragBegin(int touchId) { if (sDragging != null) { sDragging.StopDrag(); } _dragTouchId = touchId; Vector2 pos = Stage.inst.GetTouchPosition(touchId); sGlobalDragStart.x = pos.x / GRoot.contentScaleFactor; sGlobalDragStart.y = pos.y / GRoot.contentScaleFactor; sGlobalRect = this.GetGlobalRect(); sDragging = this; Stage.inst.onMouseUp.Add(__mouseUp2); Stage.inst.onMouseMove.Add(__mouseMove2); }