private void UnpauseGame()
 {
     if (state == GameSate.Paused)
     {
         state = GameSate.Playing;
         Time.timeScale = 1;
     }
 }
        private void MainMenu()
        {
            currentGameState = GameSate.MainMenu;

            do
            {
                Console.Clear();
                Console.WriteLine("Welcome to Durak game!\n");

                Console.WriteLine("1. Start new game (start)");
                Console.WriteLine("2. Save game (save)");
                Console.WriteLine("3. Load game (load)");
                Console.WriteLine("4. Options (options)");
                Console.WriteLine("5. Quit (quit)");

                Console.WriteLine("Choose variant: ");

                userInput = Console.ReadLine().ToLower();

                switch (userInput)
                {
                    case "start":
                        isGameStarted = true;
                        Console.WriteLine("Starting game");
                        PlayGame();
                        break;
                    case "save":
                        Console.WriteLine("Not implemented!");
                        break;
                    case "load":
                        Console.WriteLine("Not implemented!");
                        break;
                    case "options":
                        Console.WriteLine("Not implemented!");
                        break;
                    case "quit":
                        isGameQuit = true;
                        Console.WriteLine("Quit!");
                        QuitGame();
                        break;
                    default:
                        Console.WriteLine("Incorrect choice!");
                        break;
                }

                Console.ReadKey(false);

                if (isGameStarted || isGameQuit)
                {
                    isOutOfMainMenu = true;
                }
            }
            while (!isOutOfMainMenu);

            Console.WriteLine("Out of Main Menu!");
        }
    public void SpawnPlayer() {

        PlayerController player = FindObjectOfType<PlayerController>();
        player.transform.position = StartSpawnPoint.transform.position;

        plMotor.Stop();

        state = GameSate.Playing;

    }
    private void PauseGame()
    {

        if (state == GameSate.Paused) return;

        if (canBePaused)
        {
            state = GameSate.Paused;
            Time.timeScale = 0.1f;
        }
        
    }
 private void GameOver()
 {
     currentGameState = GameSate.GameOver;
 }
 private void QuitGame()
 {
     currentGameState = GameSate.Quit;
 }
        private void PlayGame()
        {
            currentGameState = GameSate.Playing;

            _deck.ShowCards();

            //
        }
 private void Play()
 {
     while (true)
     {
         switch (currentGameState)
         {
             case GameSate.PreLoad:
                 currentGameState = GameSate.MainMenu;
                 break;
             case GameSate.MainMenu:
                 MainMenu();
                 break;
             case GameSate.Playing:
                 PlayGame();
                 break;
             case GameSate.Paused:
                 PauseGame();
                 break;
             case GameSate.GameOver:
                 GameOver();
                 break;
             case GameSate.Quit:
                 QuitGame();
                 break;
             default:
                 break;
         }
     }
 }
 private void PauseGame()
 {
     currentGameState = GameSate.Paused;
 }
    public void CheckWinConditions() {

        bool AllConditionsFulfiled = false;
        if (state == GameSate.Paused) return;        

        // Here will be added new win conditions.
        AllConditionsFulfiled = FinishArea.IsFinished;

        
        if (AllConditionsFulfiled) state = GameSate.Win;
        else state = GameSate.Playing;

    }