Exemple #1
0
    public static void CleanTable()
    {
        TurnArrowController.TurnArrowOff();
        TrumpSelection.Hide();
        ScoreBoard.Hide();
        staticGameTable.SetGameState(Common.Enums.GameState.INLOBBY);
        Game.Actors.ScoreBoard.ResetScores();
        BiddingPopup.Hide();
        CurrentTrump.currentTrumpActive = false;
        UserInteraction.InputActive     = false;

        foreach (Transform card in GameObject.FindGameObjectWithTag("DECK").transform)
        {
            if (!card.name.Contains("Card"))
            {
                Destroy(card.gameObject);
            }
        }

        PlayedCardsController.Cards[0].gameObject.SetActive(false);
        PlayedCardsController.Cards[1].gameObject.SetActive(false);
        PlayedCardsController.Cards[2].gameObject.SetActive(false);
        PlayedCardsController.Cards[3].gameObject.SetActive(false);

        PlayedCardsController.playedCardCount = 0;
    }
    void OnGUI()
    {
        GUI.depth = 10;
        GUI.skin  = GameCreationMenuSkin;
        GUI.BeginGroup(new Rect(0, 0, Screen.width, Screen.height));
        GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), Background);

        if (GUI.Button(new Rect(Screen.width / 25, Screen.height / 25, Properties.BackButtonSize, Properties.BackButtonSize), Properties.BackButton))
        {
            MainMenu.Show();
            Hide();
        }


        float offset = Screen.height / 20;

        GUI.DrawTexture(new Rect(Screen.width / 2 - LOGO_SIZE, offset, LOGO_SIZE * 2, LOGO_SIZE), Logo);

        offset += LOGO_SIZE + offset;

        float button_size = Screen.width / 9 * 4;

        GUI.Box(new Rect(Screen.width / 2 - button_size, offset, button_size * 2, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("GMENDCNDTN"));
        offset           += Properties.TEXT_HEIGHT * 2 + Properties.TEXT_HEIGHT / 3;
        gameTypeSelection = GUI.SelectionGrid(new Rect(Screen.width / 2 - button_size, offset, button_size * 2, Properties.TEXT_HEIGHT * 2), gameTypeSelection, selStrings, 2);

        offset += Properties.TEXT_HEIGHT * 3;
        string condition = string.Empty;

        if (gameTypeSelection == 0)
        {
            condition = LanguageManager.getString("HNDCNT");
        }
        else
        {
            condition = LanguageManager.getString("TRGTSCR");
        }
        GUI.Box(new Rect(Screen.width / 2 - button_size - Screen.width / 40, offset, button_size, Properties.TEXT_HEIGHT * 2), condition);
        gameGoal = GUI.TextField(new Rect(Screen.width / 2 + Screen.width / 40, offset, button_size, Properties.TEXT_HEIGHT * 2), gameGoal);

        bool isValid = ValidateGoalInput();

        offset += Properties.TEXT_HEIGHT * 3;
        if (GUI.Button(new Rect(Screen.width / 2 - button_size / 2, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("STRTGM")) && isValid)
        {
            LoadingScreen.Show();
            Properties.ActiveGameType = GameType.SinglePlayer;
            MultiplayerObjects.gameObject.SetActive(false);
            TrumpSelection.Hide();
            ScoreBoard.Hide();
            PlayerStats.Show();
            UIGameTable.CleanTable();
            StartCoroutine(StartSinglePlayerGame());
        }

        GUI.EndGroup();
    }
Exemple #3
0
    private void HandleActionRequest(ActionType actionRequest)
    {
        unityPlayer.SoundManager.PlayTurnReadySound();
        switch (actionRequest)
        {
        case ActionType.DO_BIDDING:
            UserInteraction.InputActive = false;
            biddingPopup.SetCurrentRound(gameTable.GetGameInstance().GetCurrentRound() as Assets.Scripts.Game.Actors.UnityRound);
            biddingPopup.SetActive(true);
            break;

        case ActionType.PLAY_CARD:
            UserInteraction.InputActive = true;
            unityPlayer.Test("Play Card");
            break;

        case ActionType.SET_TRUMP_TYPE:
            UserInteraction.InputActive = false;
            TrumpSelection.Show();
            break;
        }
    }
Exemple #4
0
    void OnGUI()
    {
        GUI.depth = 10;
        GUI.skin  = MainMenuSkin;
        GUI.BeginGroup(new Rect(0, 0, Screen.width, Screen.height));
        GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), Background);

        if (Application.platform != RuntimePlatform.IPhonePlayer && GUI.Button(new Rect(Screen.width / 25, Screen.height / 25, Properties.BackButtonSize, Properties.BackButtonSize), Properties.BackButton))
        {
            DialogBox.DialogBoxButtons = DialogBoxButtons.YES_NO;
            DialogBox.DialogText       = LanguageManager.getString("PROMPT_EXIT");
            DialogBox.CallbackObject   = gameObject;
            DialogBox.Show();
        }

        float offset = Screen.height / 20;

        GUI.DrawTexture(new Rect(Screen.width / 2 - LOGO_SIZE, offset, LOGO_SIZE * 2, LOGO_SIZE), Logo);

        offset += LOGO_SIZE + offset;

        float button_size = Screen.width / 3 * 2;

        if (UserInteraction.InGame)
        {
            if (GUI.Button(new Rect(Screen.width / 2 - button_size / 2, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("CNTNE")))
            {
                PlayerStats.Show();
                Hide();
            }
            offset += Properties.TEXT_HEIGHT * 3;
        }

        if (GUI.Button(new Rect(Screen.width / 2 - button_size / 2, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("SNGPLYR")))
        {
            Hide();
            SinglePlayerCreationMenu.Show();
        }

        offset += Properties.TEXT_HEIGHT * 3;

        if (GUI.Button(new Rect(Screen.width / 2 - button_size / 2, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("MLTPLYR")))
        {
            TrumpSelection.Hide();
            ScoreBoard.Hide();
            Properties.ActiveGameType = GameType.MultiPlayer;
            MultiplayerObjects.gameObject.SetActive(true);
            LoginScreen.Show();
            UserInteraction.InGame = false;
            Hide();
        }

        offset += Properties.TEXT_HEIGHT * 3;
        if (GUI.Button(new Rect(Screen.width / 2 - button_size / 2, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("CRDTSBTN")))
        {
            Hide();
            CreditsMenu.Show();
        }

        offset += Properties.TEXT_HEIGHT * 3;
        if (GUI.Button(new Rect(Screen.width / 2 - button_size / 2, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("STNGS")))
        {
            Hide();
            SettingsMenu.BackMenu = this.GetType();
            SettingsMenu.Show();
        }

        GUI.EndGroup();
    }