예제 #1
0
    public override void Tick()
    {
        if (!startState)
        {
            return;
        }

        if (changeShapeDelayTimer > 0)
        {
            changeShapeDelayTimer -= Time.deltaTime;
            return;
        }

        if ((readInput || isTutorial) && SwipeController.IsSwiping(Direction.Right))
        {
            SwipeController.RightSwipe();
            shapeCtrl.ChangeShape(Direction.Right, true);
            changeShapeDelayTimer = changeShapeDelayTime;

            if (isTutorial)
            {
                EndTutorial();
            }
        }
        else if ((readInput || isTutorial) && SwipeController.IsSwiping(Direction.Left))
        {
            SwipeController.LeftSwipe();
            shapeCtrl.ChangeShape(Direction.Left, true);
            changeShapeDelayTimer = changeShapeDelayTime;

            if (isTutorial)
            {
                EndTutorial();
            }
        }
    }