Пример #1
0
 void PlayerMovement()
 {
     if (Input.GetKeyUp(downButton) || Input.GetKeyUp(rightButton) || Input.GetKeyUp(leftButton))
     {
         tetromino.CheckUserInput();
     }
     if (Input.GetKey(downButton) || Time.time - fall >= fallSpeed)
     {
         tetromino.VerticalMovement(nextTetromino);
     }
     else if (Input.GetKeyDown(rotateButton))
     {
         tetromino.Rotation(nextTetromino);
     }
     else if (Input.GetKey(leftButton))
     {
         tetromino.LeftMovement(nextTetromino);
     }
     else if (Input.GetKey(rightButton))
     {
         tetromino.RightMovement(nextTetromino);
     }
 }