Пример #1
0
    public void ReceiveInput(Shape.Direction direction)
    {
        if (isTutorialInProgress)
        {
            tutorialScript.ReceiveInput(direction);
        }
        if (!isGameInProgress || isRotationInProgress)
        {
            return;
        }
        switch (direction)
        {
        case Shape.Direction.NONE:
            return;

        case Shape.Direction.SPEEDDOWN:

            break;

        case Shape.Direction.SPEEDUP:
            SpeedUp();
            break;

        default:
            RotateShape(direction);
            break;
        }
    }
Пример #2
0
 public void RotateShape(Shape.Direction direction)
 {
     isRotationInProgress = true;
     currentShape.Rotate(direction);
     cubeVisualizer.ApplyShapeRotation(direction);
     cubeVisualizer.DisplayCollisionIndicator(currentShape.GetHeightMap());
     graphicsManager.RecolorShape(cubeVisualizer.ShapeVisuals);
     timeRemainingUntilCollision = cubeVisualizer.calculateTimeUntilCollision();
     soundManager.PlayRotateAudio();
 }
Пример #3
0
 public void ReceiveInput(Shape.Direction direction)
 {
     if (direction == tutorialStages[currentStage].directionToProgress)
     {
         currentStage++;
         if (currentStage == 5)
         {
             gameMaster.OnTutorialFinished();
             tutorialUi.SetActive(false);
         }
         else
         {
             gameMaster.RotateShape(direction);
             touchAnimatior.Play(tutorialStages[currentStage].animationName);
         }
     }
 }
Пример #4
0
    public void ApplyShapeRotation(Shape.Direction direction)
    {
        switch (direction)
        {
        case Shape.Direction.UP:
            StartCoroutine(AnimateRotation(shapeVisuals.transform, 90, false, rotationLength, OnRotationEnded));
            break;

        case Shape.Direction.DOWN:
            StartCoroutine(AnimateRotation(shapeVisuals.transform, -90, false, rotationLength, OnRotationEnded));
            break;

        case Shape.Direction.LEFT:
            StartCoroutine(AnimateRotation(shapeVisuals.transform, 90, true, rotationLength, OnRotationEnded));
            StartCoroutine(AnimateRotation(cameraOrieantator.transform, 90, true, rotationLength, OnRotationEnded));
            break;

        case Shape.Direction.RIGHT:
            StartCoroutine(AnimateRotation(shapeVisuals.transform, -90, true, rotationLength, OnRotationEnded));
            StartCoroutine(AnimateRotation(cameraOrieantator.transform, -90, true, rotationLength, OnRotationEnded));
            break;
        }
    }