Exemplo n.º 1
0
 void Tap(SwipeController.SwipeType type)
 {
     if (type == SwipeController.SwipeType.Tap)
     {
         energy.AddEnergy(addeng);
     }
 }
Exemplo n.º 2
0
    void OnSwipe(SwipeController.SwipeType type)
    {
        if (Debug.isDebugBuild)
        {
            Debug.Log("OnSwipe type=" + type);
        }
        switch (type)
        {
        case SwipeController.SwipeType.LEFT:
            ChangePage(ChangingPageType.NEXT);
            break;

        case SwipeController.SwipeType.RIGT:
            ChangePage(ChangingPageType.BACK);
            break;

        case SwipeController.SwipeType.UP:
            break;

        case SwipeController.SwipeType.DOWN:
            break;

        case SwipeController.SwipeType.TOUCH:
            loadBook();
            break;

        default:
            break;
        }
    }
Exemplo n.º 3
0
 void CheckSwipeInput(SwipeController.SwipeType type)
 {
     if (type == SwipeController.SwipeType.LEFT && menuSelection < menuPositions)
     {
         menuSelection++;
         Animate();
     }
     else if (type == SwipeController.SwipeType.RIGHT && menuSelection > 1)
     {
         menuSelection--;
         Animate();
     }
 }
Exemplo n.º 4
0
    private void RejectPlayer(SwipeController.SwipeType type)
    {
        switch (type)
        {
        case SwipeController.SwipeType.LEFT:
            _rigidbody.velocity += -_constrainedCenter.right * _deflectionSpeed * Time.deltaTime;
            break;

        case SwipeController.SwipeType.RIGHT:
            _rigidbody.velocity += _constrainedCenter.right * _deflectionSpeed * Time.deltaTime;
            break;
        }
    }
Exemplo n.º 5
0
    private void RotateCenter(SwipeController.SwipeType type)
    {
        switch (type)
        {
        case SwipeController.SwipeType.LEFT:
            transform.RotateAround(transform.position, transform.up, -_rotationSpeed * Time.deltaTime);
            break;

        case SwipeController.SwipeType.RIGHT:
            transform.RotateAround(transform.position, transform.up, _rotationSpeed * Time.deltaTime);
            break;
        }
    }
    void CheckInput(SwipeController.SwipeType type)
    {
        if (type == SwipeController.SwipeType.UP && isGrounded())
        {
            // Debug.Log("Jump");
            Jump();
        }

        if (type == SwipeController.SwipeType.RIGHT)
        {
            ChangeLine(1);
        }
        else if (type == SwipeController.SwipeType.LEFT)
        {
            ChangeLine(-1);
        }
    }
Exemplo n.º 7
0
 protected void CheckSwipe(SwipeController.SwipeType type)
 {
     if (!EyeChangeController.eyeChangeController.IsEyes && !ObstaclesChecker.obstaclesChecker.IsBoost && !Rabbit.rabbit.IsMove)
     {
         ObstaclesChecker.obstaclesChecker.IsGrass = false;
         if (type == SwipeController.SwipeType.UP)
         {
             _direction = new Vector3(-_distance, 0, 0);
             if (!Rabbit.rabbit.IsMove)
             {
                 Rabbit.rabbit.TargetPosition = transform.position + _direction;
             }
             Rabbit.rabbit.IsMove = true;
         }
         if (type == SwipeController.SwipeType.DOWN)
         {
             _direction = new Vector3(_distance, 0, 0);
             if (!Rabbit.rabbit.IsMove)
             {
                 Rabbit.rabbit.TargetPosition = transform.position + _direction;
             }
             Rabbit.rabbit.IsMove = true;
         }
         if (type == SwipeController.SwipeType.RIGHT)
         {
             _direction = new Vector3(0, 0, _distance);
             if (!Rabbit.rabbit.IsMove)
             {
                 Rabbit.rabbit.TargetPosition = transform.position + _direction;
             }
             Rabbit.rabbit.IsMove = true;
         }
         if (type == SwipeController.SwipeType.LEFT)
         {
             _direction = new Vector3(0, 0, -_distance);
             if (!Rabbit.rabbit.IsMove)
             {
                 Rabbit.rabbit.TargetPosition = transform.position + _direction;
             }
             Rabbit.rabbit.IsMove = true;
         }
         StepCounter.stepCounter.Count++;
     }
 }
Exemplo n.º 8
0
 void CheckSwipeInput(SwipeController.SwipeType type)
 {
     if (type == SwipeController.SwipeType.LEFT)
     {
         lineNumber += -1;
         lineNumber  = Mathf.Clamp(lineNumber, 0, lineCount);
     }
     else if (type == SwipeController.SwipeType.RIGHT)
     {
         lineNumber += 1;
         lineNumber  = Mathf.Clamp(lineNumber, 0, lineCount);
     }
     else if (type == SwipeController.SwipeType.UP)
     {
         startJumping = true;
     }
     else if (type == SwipeController.SwipeType.DOWN)
     {
         startRolling = true;
     }
 }
Exemplo n.º 9
0
    private void CheckInput(SwipeController.SwipeType type)
    {
        if (type == SwipeController.SwipeType.RIGHT)
        {
            _directionChangeLane = 1;
        }
        else if (type == SwipeController.SwipeType.LEFT)
        {
            _directionChangeLane = -1;
        }

        _laneNumber += _directionChangeLane;
        _laneNumber  = Mathf.Clamp(_laneNumber, 0, _laneCount);

        if (type == SwipeController.SwipeType.UP)
        {
            _priorityIndentifier.NotGivePriority();
        }
        else if (type == SwipeController.SwipeType.DOWN)
        {
            _priorityIndentifier.GivePriority();
        }
    }
Exemplo n.º 10
0
    void CheckInput(SwipeController.SwipeType type)
    {
        if (isGrounded() && GM.CanPlay && !isRolling)
        {
            if (type == SwipeController.SwipeType.UP)
            {
                wannaJump = true;
            }
            else if (type == SwipeController.SwipeType.DOWN)
            {
                StartCoroutine(DoRoll());
            }
        }

        int sign = 0;

        if (!GM.CanPlay || isRolling)
        {
            return;
        }

        if (type == SwipeController.SwipeType.LEFT)
        {
            sign = -1;
        }
        else if (type == SwipeController.SwipeType.RIGHT)
        {
            sign = 1;
        }
        else
        {
            return;
        }

        laneNumber += sign;
        laneNumber  = Mathf.Clamp(laneNumber, 0, lanesCount);
    }