Beispiel #1
0
    public void NewGame()
    {
        //UINavigationController.DismissAllControllers();
        //UINavigationController.ClearControllers();

        EndGame();
        UINavigationController.PushController("/Play");
    }
Beispiel #2
0
    public void StartTurn(MainGameController.PlayerInfo playerInfo)
    {
        var profile = playerInfo.playerData.GetPlayerProfile();

        Debug.Log("StartTurn: " + profile.Name);

        yourTurnDialog.ChangeText(profile.Name + System.Environment.NewLine + "TURN");
        UINavigationController.PushController(yourTurnDialog);
    }
Beispiel #3
0
    public void ShowQuestionsPanel(QuestionData.question q)
    {
        SetButtonEnabled(true);

        MainGameController.ShowHud(false);
        UINavigationController.PushBackground("/MainBackground");
        UINavigationController.PushController(questionDialog);

        PrepareQuestion(q);
    }
Beispiel #4
0
    protected void OnlineMultiplayerGame(GameData.DataSlot dataSlot)
    {
        OnlineGameClient plugin = gameObject.GetComponent <OnlineGameClient>();

        if (plugin == null)
        {
            plugin = gameObject.AddComponent <OnlineGameClient>();
        }
        SetGameClientPlugin(plugin);

        UINavigationController.PushController(connectionViewController);
        GameClientPlugin.Connect();
    }
Beispiel #5
0
    /// <summary>
    /// Called after a player is landed on WinAPillarOrGoTschool and answer correctly
    /// </summary>
    /// <param name="player">Player.</param>
    private void ProcessAfterPlayerMovedToWinAPillarOrGoToSchool(PlayerController player)
    {
        currentPlayerGotPillar = player;

        GameData.PillarType pillar;
        if (player.GetFreePillar(out pillar))
        {
            UINavigationController.PushController("/WinPillar", (c) => {
                WinPillarController pillarController = (WinPillarController)c;
                if (pillarController)
                {
                    pillarController.PillarWon(pillar);
                    pillarController.target = this.gameObject;
                    pillarController.func   = "AddFreePillar";
                }
            }, null);
        }
    }
Beispiel #6
0
    /// <summary>
    /// Called after a player is succesfully landed on the target block and the player is correctly answers
    /// </summary>
    /// <param name="player">Player.</param>
    private void ProcessAfterPlayerMoved(PlayerController player)
    {
        if (activeNode != null)
        {
            currentPlayerGotPillar = player;

            Debug.Log("Player has moved to " + activeNode);
            if (activeNode.isPillar)
            {
                var pillar = GameData.GetColorTypeFromNodeType(activeNode.nodeType);

                UINavigationController.PushController("/WinPillar", (c) => {
                    WinPillarController pillarController = (WinPillarController)c;
                    if (pillarController)
                    {
                        pillarController.PillarWon(pillar);
                        pillarController.target = this.gameObject;
                        pillarController.func   = "AddPillar";
                    }
                }, null);
            }
            else
            {
                switch (activeNode.nodeType)
                {
                case NodeType.Root:
                    ShowHud(false);
                    UINavigationController.PushBackground("/MainBackground");
                    UINavigationController.PushController("/GameOver");
                    break;

                default:
                    GameClientPlugin.EndTurn(null);
                    break;
                }
            }
        }
    }
Beispiel #7
0
    /// <summary>
    /// Event where a player is selected and Proceed selected to continut to game - Default/Customized
    /// </summary>
    protected void OnSelectPlayer()
    {
        // Get selected profile
        UIButtonSelection sel = GetCurrentSelectionButton();

        // Get the index of the player profile
        int selectionIndex = GetSelectionButtonIndex(sel);

        PlayerProfile.current.selectedProfileIndex = selectionIndex;

        // Get the current game data slot
        var dataSlot = GameData.current.GetCurrentDataSlot();

        dataSlot.ClearPlayer();

        // Add the selected player to it
        var player = dataSlot.AddPlayer(selectionIndex);

        // Set the Color Path for the selected player
        player.colorPath = PlayerProfile.current.GetColorPathFromProfile(selectionIndex);

        Debug.Log("Player Selection: " + selectionIndex);

        GameData.Save();

        PlayerProfile.Save();


        if (dismissOnSelect)
        {
            UINavigationController.DismissController();
        }
        else
        {
            UINavigationController.PushController(controllerRedirectOnSelect);
        }
    }
Beispiel #8
0
 public void ShowCategory(Node node)
 {
     MainGameController.ShowHud(false);
     UINavigationController.PushBackground("/MainBackground");
     UINavigationController.PushController(questionCategoryDialog);
 }