public void OnPointerUp(PointerEventData eventData) { _isPressed = false; if (_isDragging) { return; } onPointerUpEvent?.Invoke(); }
public static void TriggerEvent(TypeOfEvent theType, EventInfo triggerInfo) { MyUnityEvent thisEvent = null; if (eventManager.eventDictionary.TryGetValue(theType, out thisEvent)) { thisEvent.Invoke(triggerInfo); } }
public void OnPointerUp(PointerEventData eventData) { if (!IsTouching) { return; } IsTouching = false; OnTouchEnd.Invoke(TouchGetter.GetTouchPositon()); }
public virtual void Hide() { StartCoroutine(KKUtilities.FloatLerp(showAnimationTime * 0.5f, (t) => { panel.Alpha = Mathf.Lerp(panel.DefaultAlpha, 0.0f, Easing.OutQuad(t)); })); StartCoroutine(hideAnimation.GetAnimation(this, hideAnimationTime).OnCompleted(() => { panel.gameObject.SetActive(false); Container.SetActive(false); OnHideAnimationEnd.Invoke(); })); }
void OnTouching(Vector2 touchPosition) { //移動量の計算 touchPosition = TouchGetter.GetTouchPositon(); DeltaPosition = (touchPosition - oldTouchPosition) * screenSizeRate; oldTouchPosition = touchPosition; //スワイプ中にCanTouchがfalseになった if (isStartTouch && !CanTouch) { isStartTouch = false; if (onTouchEnd != null) { onTouchEnd.Invoke(oldTouchPosition); } } //操作受け中ではなかった if (!isStartTouch || !CanTouch) { return; } if (swipePower < swipePowerBoder) { touchTime += Time.deltaTime; swipeValue += DeltaPosition; swipePower = swipeValue.magnitude; } else { if (onSwipe != null) { onSwipe.Invoke(DeltaPosition); } } }
public virtual void Show() { panel.gameObject.SetActive(true); Container.SetActive(true); Alpha = 1; StartCoroutine(KKUtilities.FloatLerp(showAnimationTime * 0.5f, (t) => { panel.Alpha = Mathf.Lerp(0.0f, panel.DefaultAlpha, Easing.InQuad(t)); })); StartCoroutine(showAnimation.GetAnimation(this, showAnimationTime).OnCompleted(() => { OnShowAnimationEnd.Invoke(); })); }
void OnTouchStart(Vector2 touchPosition) { isStartTouch = CanTouch; if (!isStartTouch) { return; } DeltaPosition = Vector2.zero; swipePower = 0.0f; swipeValue = Vector2.zero; touchTime = 0.0f; oldTouchPosition = TouchGetter.GetTouchPositon(); if (onTouchStart != null) { onTouchStart.Invoke(touchPosition); } }
void OnTouchEnd(Vector2 touchPosition) { if (!isStartTouch || !CanTouch) { return; } if (swipePower < swipePowerBoder) { if (onTap != null) { onTap.Invoke(touchPosition); } } if (onTouchEnd != null) { onTouchEnd.Invoke(touchPosition); } DeltaPosition = Vector2.zero; }
public void OnPointerDown(PointerEventData eventData) { IsTouching = true; OnTouchStart.Invoke(TouchGetter.GetTouchPositon()); }