示例#1
0
        public EatResponse OnDrag(int id, GameObject target, Vector2 screenPosition, Vector3 groundPosition)
        {
            if (Service.UserInputInhibitor.IsDenying())
            {
                this.Reset();
                return(EatResponse.NotEaten);
            }
            MapFinger mapFinger = this.TranslateToFinger(id);

            if (mapFinger != MapFinger.Anchor)
            {
                return(EatResponse.NotEaten);
            }
            if (this.isPressed)
            {
                float num = Service.GalaxyViewController.UpdateGalaxyRotation(groundPosition, this.lastGroundPosition, this.initialPos);
                this.lastGroundPosition = groundPosition;
                this.lastScreenPosition = screenPosition;
                if (Mathf.Abs(num) >= 0.25f)
                {
                    this.isMoving = true;
                    if ((num > 0f && this.movementAmount < 0f) || (num < 0f && this.movementAmount > 0f))
                    {
                        this.ResetSwipe();
                    }
                    this.movementAmount   += num;
                    this.pressedGameObject = null;
                }
            }
            return(EatResponse.Eaten);
        }
示例#2
0
        public EatResponse OnRelease(int id)
        {
            if (Service.UserInputInhibitor.IsDenying())
            {
                this.Reset();
                return(EatResponse.NotEaten);
            }
            MapFinger mapFinger = this.TranslateToFinger(id);

            if (mapFinger != MapFinger.Anchor)
            {
                return(EatResponse.NotEaten);
            }
            this.HandleRelease();
            return(EatResponse.NotEaten);
        }
示例#3
0
        public EatResponse OnDrag(int id, GameObject target, Vector2 screenPosition, Vector3 groundPosition)
        {
            MapFinger mapFinger = this.TranslateToFinger(id);

            if (mapFinger != MapFinger.Anchor)
            {
                if (mapFinger != MapFinger.Pinch)
                {
                    return(EatResponse.NotEaten);
                }
                this.pinchScreenPosition = screenPosition;
                this.pinchGroundPosition = groundPosition;
            }
            else
            {
                this.anchorScreenPosition = screenPosition;
                this.anchorGroundPosition = groundPosition;
            }
            this.HandleAnchorAndPinch();
            return(EatResponse.Eaten);
        }
示例#4
0
        public EatResponse OnPress(int id, GameObject target, Vector2 screenPosition, Vector3 groundPosition)
        {
            if (this.switchingVantage)
            {
                return(EatResponse.Eaten);
            }
            MapFinger mapFinger = this.ChooseFinger(id);

            if (mapFinger != MapFinger.Anchor)
            {
                if (mapFinger != MapFinger.Pinch)
                {
                    return(EatResponse.NotEaten);
                }
                this.pinchScreenPosition     = screenPosition;
                this.pinchLastScreenPosition = this.pinchScreenPosition;
                this.pinchGroundPosition     = groundPosition;
                this.pinchLastGroundPosition = this.pinchGroundPosition;
            }
            else
            {
                this.anchorScreenPosition     = screenPosition;
                this.anchorLastScreenPosition = this.anchorScreenPosition;
                this.anchorGroundPosition     = groundPosition;
                this.anchorLastGroundPosition = this.anchorGroundPosition;
            }
            this.camera.StopMoving();
            if (this.scrollTimer != 0u)
            {
                Service.Get <ViewTimerManager>().KillViewTimer(this.scrollTimer);
                this.scrollTimer     = 0u;
                this.scrollImmediate = false;
            }
            this.camera.SetCameraFeel(CameraFeel.Fast);
            this.HandleAnchorAndPinch();
            Service.Get <EventManager>().SendEvent(EventId.UserStartedCameraMove, null);
            return(EatResponse.Eaten);
        }
示例#5
0
        public EatResponse OnPress(int id, GameObject target, Vector2 screenPosition, Vector3 groundPosition)
        {
            if (Service.UserInputInhibitor.IsDenying())
            {
                this.Reset();
                return(EatResponse.NotEaten);
            }
            MapFinger mapFinger = this.ChooseFinger(id);

            if (mapFinger != MapFinger.Anchor)
            {
                return(EatResponse.NotEaten);
            }
            if (!this.isPressed)
            {
                this.isPressed          = true;
                this.lastScreenPosition = screenPosition;
                this.lastGroundPosition = groundPosition;
                this.initialPos         = groundPosition;
                this.pressedGameObject  = target;
            }
            return(EatResponse.Eaten);
        }
示例#6
0
        public EatResponse OnRelease(int id)
        {
            MapFinger mapFinger = this.TranslateToFinger(id);

            if (mapFinger != MapFinger.Anchor)
            {
                if (mapFinger != MapFinger.Pinch)
                {
                    return(EatResponse.NotEaten);
                }
                this.AbandonPinch();
            }
            else
            {
                this.AbandonAnchor();
            }
            this.HandleAnchorAndPinch();
            if (this.anchorFingerId < 0)
            {
                this.EnsureWithinBounds();
            }
            return(EatResponse.NotEaten);
        }