public void UpdateScore(int score, GameData.Mode gameMode, int player2Score)
 {
     scoreText.text = "Player 1 score: " + score.ToString();
     if (gameMode == GameData.Mode.BattleMode)
     {
         player2ScoreText.text = "Player 2 score: " + player2Score.ToString();
     }
 }
Exemple #2
0
    /*public void SetupDie()
     * {
     *  // sets up the die
     * }*/

    /*public void SetupCameras()
     * {
     *  // sets up the cameras
     *  GameData.SetMainCamera(Camera.allCameras[0]);
     *  GameData.SetDieCamera(Camera.allCameras[1]);
     * }*/

    public void RollDie(GameData.Mode mode)
    {
        //analytics
        if (GameData.GetGameMode() == GameData.Mode.NormalRoll)
        {
            GameGUI.analyticsGameCompleted.Rolled();
        }
        // Switches to the roll screen

        // switch view (main camera position)
        GameData.SetGameMode(mode);
        Camera.main.transform.position    = GameData.GetDieCameraPosition();
        Camera.main.transform.eulerAngles = GameData.GetDieCameraRotation();

        // show title and roll button
        GameGUI.ShowRollScreen();
    }
Exemple #3
0
    public void SwitchGameMode(GameData.Mode mode)
    {
        GameData.gameMode = mode;
        switch (mode)
        {
        case GameData.Mode.Fishing:
        {
            CameraController.Instance.mode = CameraController.CameraMode.Fishing;
            UI_Manager.Instance.OpenMenu(GameData.FishingMenu);
            Question.Instance.RegenerateRandomQuestion();
            Player.Instance.EquipRod();
            GameData.isInMenu = true;
        }
        break;

        case GameData.Mode.Shopping:
        {
            CameraController.Instance.mode = CameraController.CameraMode.Shopping;
            UI_Manager.Instance.OpenMenu(GameData.ShopMenu);
            ShopUI.Instance.Activate();
            GameData.isInMenu = true;
        }
        break;

        case GameData.Mode.Free:
        {
            CameraController.Instance.mode = CameraController.CameraMode.FollowPlayer;
            UI_Manager.Instance.OpenMenu(GameData.InGameUI);

            GameData.MoneyText.text = Player.Instance.data.gold.ToString() + GameData.ActiveLanguage.currencySign;
            GameData.isInMenu       = false;

            Player.Instance.UnequipRod();

            if (Player.Instance.isMoving)
            {
                Player.Instance.ResumeOnDestination();
            }
            GameData.SaveGame();
        }
        break;
        }
    }