Exemplo n.º 1
0
 void OnReleaseAnyWhere(InputTouch touch)
 {
     this.mPressTouch = null;
     this.mPressItem  = null;
 }
Exemplo n.º 2
0
 void OnClickItem(InputTouch touch, DragListItem item)
 {
     XCSharp.InvokeAction(this.onClickItem, this, item);
 }
Exemplo n.º 3
0
        void OnMoveAnyWhere(InputTouch touch)
        {
            if (this.mPressTouch == null || touch.fingerId != this.mPressTouch.fingerId)
            {
                return;
            }

            RaycastHit hit;

            if (this.TouchOnColliders(this.mPressTouch, touch, out hit))
            {
                Vector3 point = this.transform.InverseTransformPoint(hit.point);
                Vector3 delta = point - this.mLastPoint;
                if (this.Approximately(delta, Vector3.zero))
                {
                    return;
                }

                this.mPressDelta += delta;
                if (this.mPressItem != null &&
                    this.mPressItem.canBeDragOut &&
                    touch.target != null &&
                    touch.target == this.mPressItem.inputTarget)
                {
                    float sqrd  = this.mPressDelta.sqrMagnitude;
                    float angle = Vector3.Angle(this.mPressDelta, this.mDirection);
                    if (sqrd > this.dragOut * this.dragOut && angle > 45 && angle < 135)
                    {
                        XCSharp.InvokeAction(this.onDragOut, this, this.mPressItem);
                        if (this.mPressItem.removeWhenDragOut)
                        {
                            this.Remove(this.mPressItem);
                        }
                        this.mPressTouch = null;
                        this.mPressItem  = null;
                        return;
                    }
                }

                delta = this.ShadowOnNomalized(delta, this.mDirection);
                delta = this.AdjustDeltaInRange(delta);

                this.mLastPoint    = point;
                this.mLastDelta    = delta;
                this.mDestination += delta;
                this.mNeedUpdate   = true;
            }
            else
            {
                if (this.mPressItem != null &&
                    this.mPressItem.canBeDragOut)
                {
                    XCSharp.InvokeAction(this.onDragOut, this, this.mPressItem);
                    if (this.mPressItem.removeWhenDragOut)
                    {
                        this.Remove(this.mPressItem);
                    }
                    this.mPressTouch = null;
                    this.mPressItem  = null;
                }
            }
        }
Exemplo n.º 4
0
 void OnPressItem(InputTouch touch, DragListItem item)
 {
     this.mPressItem = item;
     XCSharp.InvokeAction(this.onPressItem, this, item);
 }