public void GotoMainMenu()
    {
        MatControlsStatManager.gameStateChanged(GameState.GAME_UI);
        //StartCoroutine(FindObjectOfType<Transition>().FadeOutScene("Main Menu"));

        SceneManager.LoadScene("Main Menu");
    }
Exemple #2
0
 public void GotoMainMenu()
 {
     PlayerSession.Instance.CloseSPSession();
     MatControlsStatManager.gameStateChanged(GameState.GAME_UI);
     //StartCoroutine(FindObjectOfType<Transition>().FadeOutScene("Main Menu"));
     SceneManager.LoadScene("Main Menu");
 }
    public void StoreSession(bool isGameOver = false)
    {
        if (isGameOver)
        {
            MatControlsStatManager.gameStateChanged(GameState.GAME_OVER);
        }
        else
        {
            MatControlsStatManager.gameStateChanged(GameState.GAME_NEW_LIFE);
        }

        Dictionary <string, string> gameData;

        gameData = new Dictionary <string, string>();
        gameData.Add("completed-levels", ps.GetCompletedLevels().ToString());

        if (ps.GetCoinScore() > coinScore)
        {
            gameData.Add("coins-collected", ps.GetCoinScore().ToString());
        }
        else
        {
            gameData.Add("coins-collected", coinScore.ToString());
        }

        gameData.Add("active-ball", ps.Active_ball.ToString());
        gameData.Add("balls-purchased", ps.PurchasedBalls);

        PlayerSession.Instance.UpdateGameData(gameData);
        Debug.Log("Game data is updated successfully.");

        ps.CalBurned = PlayerSession.Instance.GetCaloriesBurned();
        ps.FpPoints  = (int)PlayerSession.Instance.GetFitnessPoints();

        ps.ThisSessionTimePlayed += ps.TimePlayed;
        ps.ThisSessionCalBurned  += ps.CalBurned;
        ps.ThisSessionFpPoints   += ps.FpPoints;

        /*
         * // add running action here
         * if (PlayerSession.Instance != null)
         * {
         *  PlayerSession.Instance.AddPlayerAction(YipliUtils.PlayerActions.RUNNING, FindObjectOfType<BallController>().CurrentStepCount);
         *  Debug.LogError("CurrentStepCount from store session : " + FindObjectOfType<BallController>().CurrentStepCount);
         *  FindObjectOfType<BallController>().CurrentStepCount = 0;
         * }
         */

        PlayerSession.Instance.StoreSPSession(ps.GetCoinScore());
    }
Exemple #4
0
    // Start is called before the first frame update
    void Start()
    {
        MatControlsStatManager.gameStateChanged(GameState.GAME_OVER);

        /*
         * PlayerPrefs.DeleteKey("IS_CHKP_REACHED");
         * PlayerPrefs.DeleteKey("CHKP_X");
         * PlayerPrefs.DeleteKey("CHKP_Y");
         * PlayerPrefs.DeleteKey("CHKP_Z");
         */

        SetClusterIDtoZero();

        currentButtonIndex = 0;
        manageCurrentButton();
    }
    IEnumerator frameAnimation()
    {
        checkpointFrame.SetActive(true);

        MatControlsStatManager.gameStateChanged(GameState.GAME_UI);
        yield return(new WaitForSecondsRealtime(5f));

        MatControlsStatManager.gameStateChanged(GameState.GAME_PLAY);

        checkpointFrame.SetActive(false);

        speakerT.text = "Keep Running";

        tmm.ActivateModel();
        tmm.SetRunOverride();

        Time.timeScale = 1f;
    }
Exemple #6
0
    public void pauseFunction()
    {
        isPause = true;

        if (currentScene != "Level_Tutorial")
        {
            PlayerSession.Instance.PauseSPSession();
        }

        //SetClusterIDtoZero();
        MatControlsStatManager.gameStateChanged(GameState.GAME_UI);

        InstructionCanvas.SetActive(false);
        pauseArea.SetActive(true);

        ps.AllowInput = false;

        Time.timeScale = 0f;
    }
Exemple #7
0
    public void resumeButton()
    {
        Time.timeScale = 1f;
        ps.AllowInput  = true;
        isPause        = false;

        Debug.Log("Resume Function call");
        SetClusterIDtoOne();

        MatControlsStatManager.gameStateChanged(GameState.GAME_PLAY);

        if (currentScene != "Level_Tutorial")
        {
            PlayerSession.Instance.ResumeSPSession();
        }

        InstructionCanvas.SetActive(true);
        pauseArea.SetActive(false);
    }
Exemple #8
0
    // Start is called before the first frame update
    void Start()
    {
        MatControlsStatManager.gameStateChanged(GameState.GAME_UI);

        StartCoroutine(FindObjectOfType <Transition>().FadeInScene());

        currentButtonIndex = 0;
        manageCurrentButton();

        niText.SetActive(false);

        ps.CheckPointPassed = false;
        ps.AllowInput       = false;
        ps.PlayerLives      = 3;

        if (!ps.InitialiseOldFmResponse)
        {
            ps.InitialiseOldFmResponse = true;
            PlayerSession.Instance.currentYipliConfig.oldFMResponseCount = 0;
        }
    }
    public void LoadThisLevel()
    {
        if (thisLevelNumber <= numberOfCompletedLevels + 1)
        {
            //audio.PlayOneShot(buttonClickSoundEffect);
            //PlayerPrefs.SetInt("PLAYER_LIFE", 3);
            ps.PlayerLives = 3;
            PlayerPrefs.SetInt("CURRENT_LEVEL_SERIAL", thisLevelNumber);

            MatControlsStatManager.gameStateChanged(GameState.GAME_PLAY);

            if (ps.IsTutorialMandatory)
            {
                SceneManager.LoadScene("Level_Tutorial");
            }
            else
            {
                SceneManager.LoadScene(thisLevelNumber);
            }
        }
    }
Exemple #10
0
    public void retryButton()
    {
        Time.timeScale      = 1f;
        ps.CheckPointPassed = false;
        ps.AllowInput       = true;
        isPause             = false;

        /*
         * PlayerPrefs.DeleteKey("IS_CHKP_REACHED");
         * PlayerPrefs.DeleteKey("CHKP_X");
         * PlayerPrefs.DeleteKey("CHKP_Y");
         * PlayerPrefs.DeleteKey("CHKP_Z");
         */

        Debug.Log("Retry Function call");
        //SetClusterIDtoOne();

        MatControlsStatManager.gameStateChanged(GameState.GAME_PLAY);

        InstructionCanvas.SetActive(true);
        pauseArea.SetActive(false);
        SceneManager.LoadScene(SceneManager.GetActiveScene().name);
    }
 public void GotoLevelSelect()
 {
     MatControlsStatManager.gameStateChanged(GameState.GAME_UI);
     StartCoroutine(FindObjectOfType <Transition>().FadeOutScene("Level_Selector"));
 }
 private void Awake()
 {
     //SetClusterIDtoOne();
     MatControlsStatManager.gameStateChanged(GameState.GAME_PLAY);
 }