private void OnPointerClick(EventSystemData Data) { if (!IsClick_) { return; } PointerClick?.Invoke(); CheckDoubleClick(); }
private void OnDrag(EventSystemData Data) { if (!IsDrag_) { return; } IsClick_ = false; Drag?.Invoke(Data.Location); }
private void OnPointerUp(EventSystemData Data) { if (!IsDrag_) { return; } PointerUp?.Invoke(Data.Location); CheckLongPressed(); IsDrag_ = false; PreviousDownTime_ = 0; }
private void OnPointerDown(EventSystemData Data) { if (!Enabled) { return; } PointerDown?.Invoke(Data.Location); IsDrag_ = true; IsClick_ = true; PreviousDownTime_ = Time.realtimeSinceStartup; }
private void BeginDrag(EventSystemData Data) { if (!CanUse()) { return; } IsDrag_ = true; CreateDragObject(); DragCancelObj_.gameObject.SetActive(true); OnBeginDrag(UIHelper.ScreenPosToCanvasPos(Configure.CanvasRoot, Data.Location)); }
protected override void OnCreate() { EventSystemData data = default; data.TypeIndexToBatchMap = new UnsafeHashMap <int, int>(1, Allocator.Persistent); data.Batches = new UnsafeList <EventBatch>(1, Allocator.Persistent); data.UnsafeEntityManager = EntityManager.Unsafe; data.StructuralChanges = new StructuralChangeQueue(data.UnsafeEntityManager, Allocator.Persistent); data.EventComponent = ComponentType.ReadOnly <EntityEvent>(); data.DisabledTypeIndex = TypeManager.GetTypeIndex <Disabled>(); _dataPtr = UnsafeUtility.Malloc(UnsafeUtility.SizeOf <EventSystemData>(), UnsafeUtility.AlignOf <EventSystemData>(), Allocator.Persistent); UnsafeUtility.CopyStructureToPtr(ref data, _dataPtr); }
private void OnTrayDrag(EventSystemData Data) { if (!IsMove_) { return; } if (Mathf.Abs(Data.Location.magnitude - PreviousPos_.magnitude) >= MinimumTouchDistance) { PreviousPos_ = Data.Location; var Offset = Data.Location - TouchPosition_; var Len = Mathf.Clamp(Offset.magnitude, -TraySize_, TraySize_); Slider_.anchoredPosition = (Offset.normalized * Len); MoveCallback_?.Invoke(false, Offset.normalized, Len / TraySize_); } }
private void Drag(EventSystemData Data) { if (!IsDrag_) { return; } if (DragCancelRect_.Contains(Data.Location)) { DragObjRender_.color = Color.red; } else { DragObjRender_.color = Color.green; } OnDrag(UIHelper.ScreenPosToCanvasPos(Configure.CanvasRoot, Data.Location)); }
private void EndDrag(EventSystemData Data) { IsDrag_ = false; OnEndDrag(UIHelper.ScreenPosToCanvasPos(Configure.CanvasRoot, Data.Location)); DragCancelObj_.gameObject.SetActive(false); DestroyDragObject(); if (DragCancelRect_.Contains(Data.Location)) { return; } if (!CanUse()) { return; } OnDragSpell(UIHelper.ScreenPosToCanvasPos(Configure.CanvasRoot, Data.Location)); }
private void OnTrayBeginDrag(EventSystemData Data) { IsMove_ = true; TouchPosition_ = Data.Location; PreviousPos_ = TouchPosition_; }