Пример #1
0
        // -------------------
        override public bool OnTouchStart(TouchObject touch, TouchControl sender, TouchStartType touchStartType)
        {
            if (this.touchObj != null)
            {
                return(false);
            }

            this.touchObj = touch;
            this.touchObj.AddControl(this);

            Vector3
                startPosScreen = ((touchStartType == TouchStartType.DirectPress) ? touch.screenPosStart : touch.screenPosCur),
                curPosScreen   = touch.screenPosCur,

                startPosOriented = this.ScreenToOrientedPos(startPosScreen, touch.cam),
                curPosOriented   = this.ScreenToOrientedPos(curPosScreen, touch.cam),

                startPosWorld = this.ScreenToWorldPos(startPosScreen, touch.cam),
                curPosWorld   = this.ScreenToWorldPos(curPosScreen, touch.cam);


            this.touchStateWorld.OnTouchStart(startPosWorld, curPosWorld, 0, this.touchObj);
            this.touchStateScreen.OnTouchStart(startPosScreen, curPosScreen, 0, this.touchObj);
            this.touchStateOriented.OnTouchStart(startPosOriented, curPosOriented, 0, this.touchObj);

            this.touchStartedByRegion = ((sender != null) && (sender != this));     //== this.GetDynamicRegion()));
            this.touchStartType       = touchStartType;

            return(true);
        }
 // -------------
 public SystemTouch(TouchControlPanel panel)
 {
     //this.panel		= panel;
     this.touch = new TouchObject();
     this.hwId  = 0;
     this.elapsedSinceLastAction = 0;
 }
Пример #3
0
 // ------------------
 override public void ReleaseAllTouches()
 {
     if (this.touchObj != null)
     {
         this.touchObj.ReleaseControl(this, TouchEndType.Cancel);
         this.touchObj = null;
     }
 }
Пример #4
0
        // --------------
        override public bool OnTouchStart(TouchObject touch, TouchControl sender, TouchStartType touchStartType)
        {
            if (this.targetControl != null)
            {
                return(this.targetControl.OnTouchStart(touch, this, TouchStartType.ProxyPress));
            }

            return(false);
        }
Пример #5
0
        // -------------------
        override public bool OnTouchPressureChange(TouchObject touchObj)
        {
            if ((this.touchObj == null) || (this.touchObj != touchObj))
            {
                return(false);
            }

            this.touchState.OnTouchPressureChange(touchObj.GetPressure());

            return(true);
        }
Пример #6
0
        // ----------------------
        override public void ReleaseAllTouches()
        {
            if (this.touchObj != null)
            {
                this.touchObj.ReleaseControl(this, TouchEndType.Cancel);
                this.touchObj = null;
            }

            this.touchStateWorld.OnTouchEnd(true);     //(touchEndType != TouchEndType.RELEASE)); //cancel);
            this.touchStateOriented.OnTouchEnd(true);  //(touchEndType != TouchEndType.RELEASE)); //cancel);
            this.touchStateScreen.OnTouchEnd(true);    //(touchEndType != TouchEndType.RELEASE)); //cancel);
        }
Пример #7
0
        // ------------------
        override public bool OnTouchEnd(TouchObject touchObj, TouchEndType touchEndType)
        {
            if ((this.touchObj == null) || (this.touchObj != touchObj))
            {
                return(false);
            }

            this.touchObj = null;

            this.touchState.OnTouchEnd(touchEndType != TouchEndType.Release);

            return(true);
        }
Пример #8
0
        // -------------------
        override public bool OnTouchPressureChange(TouchObject touch)
        {
            if ((touch != this.touchObj) || (this.touchObj == null))
            {
                return(false);
            }


            this.touchStateWorld.OnTouchPressureChange(touch.GetPressure());
            this.touchStateScreen.OnTouchPressureChange(touch.GetPressure());
            this.touchStateOriented.OnTouchPressureChange(touch.GetPressure());

            return(true);
        }
Пример #9
0
        // -------------------
        override public bool OnTouchEnd(TouchObject touch, TouchEndType touchEndType)
        {
            if ((touch != this.touchObj) || (this.touchObj == null))
            {
                return(false);
            }

            this.touchObj = null;
            this.touchStateWorld.OnTouchEnd(touchEndType != TouchEndType.Release);     //cancel);
            this.touchStateScreen.OnTouchEnd(touchEndType != TouchEndType.Release);    //cancel);
            this.touchStateOriented.OnTouchEnd(touchEndType != TouchEndType.Release);  //cancel);

            return(true);
        }
Пример #10
0
        // -------------------
        override public bool OnTouchMove(TouchObject touchObj)
        {
            if ((this.touchObj == null) || (this.touchObj != touchObj))
            {
                return(false);
            }

            Vector2 localPos = this.ScreenToOrientedPos(touchObj.screenPosCur, touchObj.cam);     //data.pos, data.cam);

            this.touchState.OnTouchMove(localPos);

            this.CheckSwipeOff(touchObj, this.touchStartType);

            return(true);
        }
Пример #11
0
        // ------------------
        override public bool OnTouchEnd(TouchObject touchObj, TouchEndType touchEndType)
        {
            if ((this.touchObj == null) || (this.touchObj != touchObj))
            {
                return(false);
            }

//Debug.LogFormat("----------------Track pad END!!!! : {0} : active:{1}", Time.frameCount, this.IsActive());

            this.touchObj = null;

            this.touchState.OnTouchEnd(touchEndType != TouchEndType.Release);

            return(true);
        }
Пример #12
0
        // ------------------
        protected bool CheckSwipeOff(TouchObject touchObj, TouchStartType touchStartType)
        {
            if ((touchObj == null) || (this.swipeOffMode == SwipeOffMode.Disabled) ||
                ((this.swipeOffMode == SwipeOffMode.OnlyIfSwipedOver) && (touchStartType != TouchStartType.SwipeOver)))
            {
                return(false);
            }


            if (!this.RaycastScreen(touchObj.screenPosCur, touchObj.cam))
            {
                touchObj.ReleaseControl(this, TouchEndType.SwipeOff);
                return(true);
            }
            return(false);
        }
Пример #13
0
        // ------------------
        override public bool OnTouchStart(TouchObject touchObj, TouchControl sender, TouchStartType touchStartType)
        {
            if (this.touchObj != null)
            {
                return(false);
            }

            this.touchObj       = touchObj;
            this.touchStartType = touchStartType;
            this.touchObj.AddControl(this);

            Vector2 localPos = this.ScreenToOrientedPos(touchObj.screenPosStart, touchObj.cam);

            this.touchState.OnTouchStart(localPos, localPos, 0, touchObj.IsMouse());

            return(true);
        }
Пример #14
0
        // --------------
        override public bool OnTouchStart(TouchObject touch, TouchControl sender, TouchStartType touchStartType)
        {
            bool someActivated = false;

            for (int i = 0; i < this.targetControlList.Count; ++i)
            {
                TouchControl c = this.targetControlList[i];
                if (c != null)
                {
                    if (c.OnTouchStart(touch, this, TouchStartType.ProxyPress))
                    {
                        someActivated = true;
                    }
                }
            }

            return(someActivated);
        }
Пример #15
0
        // ------------------
        override public bool OnTouchStart(TouchObject touchObj, TouchControl sender, TouchStartType touchStartType)
        {
            if (this.touchObj != null)
            {
                return(false);
            }

//Debug.LogFormat("----------------Track pad start : {0} : active:{1}", Time.frameCount, this.IsActive());

            this.touchObj       = touchObj;
            this.touchStartType = touchStartType;
            this.touchObj.AddControl(this);

            Vector2 localPos = this.ScreenToOrientedPos(touchObj.screenPosStart, touchObj.cam);

            this.touchState.OnTouchStart(localPos, localPos, 0, touchObj);

            return(true);
        }
Пример #16
0
        // -------------------
        override public bool OnTouchMove(TouchObject touch) //, TouchControl sender)
        {
            if ((touch != this.touchObj) || (this.touchObj == null))
            {
                return(false);
            }

            Vector3
                posScreen   = touch.screenPosCur,
                posWorld    = this.ScreenToWorldPos(touch.screenPosCur, touch.cam),
                posOriented = this.ScreenToOrientedPos(touch.screenPosCur, touch.cam);

            this.touchStateWorld.OnTouchMove(posWorld);
            this.touchStateScreen.OnTouchMove(posScreen);
            this.touchStateOriented.OnTouchMove(posOriented);

            this.CheckSwipeOff(touch, this.touchStartType);

            return(true);
        }
Пример #17
0
        // -------------------
        override public bool CanBeTouchedDirectly(TouchObject touchObj)
        {
            if (!base.CanBeTouchedDirectly(touchObj))
            {
                return(false);
            }

            for (int i = 0; i < this.targetControlList.Count; ++i)
            {
                TouchControl c = this.targetControlList[i];
                if (c == null)
                {
                    continue;
                }

                if (c.CanBeActivatedByOtherControl(this, touchObj))
                {
                    return(true);
                }
            }

            return(false);
        }
Пример #18
0
 // --------------
 override public bool OnTouchEnd(TouchObject touch, TouchEndType touchEndType)
 {
     return(false);
 }
Пример #19
0
 public override bool CanBeSwipedOverFromRestrictedList(TouchObject touchObj)
 {
     return(this.CanBeSwipedOverFromRestrictedListDefault(touchObj));
 }
Пример #20
0
 public override bool CanBeSwipedOverFromNothing(TouchObject touchObj)
 {
     return(this.CanBeSwipedOverFromNothingDefault(touchObj));
 }
Пример #21
0
 // --------------------
 public override bool CanSwipeOverOthers(TouchObject touchObj)
 {
     return(false);
 }
Пример #22
0
 // ----------------------
 virtual public bool CanBeActivatedByOtherControl(TouchControl c, TouchObject touchObj)
 {
     return(this.IsActive());
 }
Пример #23
0
 // -----------------------
 virtual public bool CanBeTouchedDirectly(TouchObject touchObj)
 {
     return(!this.cantBeControlledDirectly && this.IsActive());
 }
Пример #24
0
 protected bool                  CanSwipeOverOthersDefault(TouchObject touchObj, TouchObject myTouchObj, TouchStartType touchStartType)
 {
     return((myTouchObj == touchObj) && ((this.swipeOverOthersMode == SwipeOverOthersMode.Enabled) ||
                                         ((this.swipeOverOthersMode == SwipeOverOthersMode.OnlyIfTouchedDirectly) && (touchStartType != TouchStartType.SwipeOver))));
 }
Пример #25
0
 // --------------------
 abstract public bool    CanSwipeOverOthers(TouchObject touchObj);
Пример #26
0
 protected bool                  CanBeSwipedOverFromRestrictedListDefault(TouchObject touchObj)
 {
     return(this.IsActive());
 }
Пример #27
0
 // ---------------------
 abstract public bool    CanBeSwipedOverFromRestrictedList(TouchObject touchObj);
Пример #28
0
 // --------------
 override public bool OnTouchMove(TouchObject touch)
 {
     return(false);
 }
Пример #29
0
 // --------------
 override public bool OnTouchPressureChange(TouchObject touch)
 {
     return(false);
 }
Пример #30
0
 protected bool                  CanBeSwipedOverFromNothingDefault(TouchObject touchObj)
 {
     return(this.canBeSwipedOver && this.IsActive());
 }