void OnLoadNextLevelClicked()
 {
     Time.timeScale = 1.0f;
     mLevelPassedUI.SetActive(false);
     HJPlayerScoreAndLevelManager.Instance().LoadNextLevel();
     HJGameEventHandler.Instance().TriggerOnNextLevelLoadEvent();
 }
 void OnRetryBtnClicked()
 {
     Time.timeScale = 1.0f;
     HJGameManager.Instance().CurrentGameState = HJGameState.eGamePlaying;
     HJGameEventHandler.Instance().TriggerRetrySameLevelEvent();
     HJPlayerScoreAndLevelManager.Instance().RestartCurrentLevel();
     mRetryScreen.SetActive(false);
 }
Exemple #3
0
        //----------------------------------------------------------------------------------------------------

        public void AddScore()
        {
            int scoreUnit = HJConfigManager.Instance().GetScoreUnitForLevel(CurrentLevel);

            CurrentScore += scoreUnit;
            NumberOfPlatformsPassed++;
            HJGameEventHandler.Instance().TriggerOnScoreChangedEvent(CurrentScore);
        }
Exemple #4
0
        //----------------------------------------------------------------------------------------------------

        void OnLoadNextLevelClicked()
        {
            AdsManager.GetInstance().ShowInterstialAds();

            Time.timeScale = 1.0f;
            gameObject.transform.localScale = Vector3.zero;
            mMainTextHolder.localPosition   = mInitialTextHolderPos;

            HJPlayerScoreAndLevelManager.Instance().LoadNextLevel();
            HJGameEventHandler.Instance().TriggerOnNextLevelLoadEvent();
        }
        private void OnDisable()
        {
            HJGameEventHandler.Instance().OnScoreChangedEvent  -= SetScoreTextInUI;
            HJGameEventHandler.Instance().OnPlayerDeathEvent   -= ShowRetryScreen;
            HJGameEventHandler.Instance().OnCurrentLevelPassed -= ShowLevelCompletionUI;


            mStartGameBtn.onClick.RemoveListener(OnStartGameBtnClicked);
            mRetryBtn.onClick.RemoveListener(OnRetryBtnClicked);
            mLoadNextLevelBtn.onClick.RemoveListener(OnLoadNextLevelClicked);
        }
 private void OnDisable()
 {
     HJGameEventHandler.Instance().OnNextLevelLoad -= InitializePlatformsForLevel;
 }
Exemple #7
0
 public void HandleOnAdClosed(object sender, EventArgs args)
 {
     MonoBehaviour.print("HandleAdClosed event received");
     RequestInterstitial();
     HJGameEventHandler.Instance().TriggerOnAdClosedEvent();
 }
Exemple #8
0
 public void HandleOnAdFailedToLoad(object sender, AdFailedToLoadEventArgs args)
 {
     MonoBehaviour.print("HandleFailedToReceiveAd event received with message: " + args.Message);
     HJGameEventHandler.Instance().TriggerOnAdFailedToShowEvent();
 }
Exemple #9
0
 private void OnDisable()
 {
     HJGameEventHandler.Instance().OnRetrySameLevel -= ResetCameraPos;
     HJGameEventHandler.Instance().OnNextLevelLoad  -= ResetCameraPos;
 }
Exemple #10
0
        //----------------------------------------------------------------------------------------------------

        private void OnEnable()
        {
            HJGameEventHandler.Instance().OnCurrentLevelPassed += ShowLevelCompletionUI;
            mLoadNextLevelBtn.onClick.AddListener(OnLoadNextLevelClicked);
        }
 public static HJGameEventHandler Instance()
 {
     return(mInstance = mInstance == null ? new HJGameEventHandler() : mInstance);
 }
        //----------------------------------------------------------------------------------------------------

        void OnGoalReached()
        {
            HJGameEventHandler.Instance().TriggerOnCurrentLevelPassedEvent();
        }
        //----------------------------------------------------------------------------------------------------

        void OnHitDeathSlice()
        {
            Debug.Log("Death sice hit ");
            HJGameManager.Instance().CurrentGameState = HJGameState.eGamePlayerDeath;
            HJGameEventHandler.Instance().TriggerOnPlayerDeathEvent();
        }
 private void OnDisable()
 {
     HJGameEventHandler.Instance().OnRetrySameLevel -= ResetBallPosition;
     HJGameEventHandler.Instance().OnNextLevelLoad  += ResetBallPosition;
 }
Exemple #15
0
        //----------------------------------------------------------------------------------------------------

        private void OnDisable()
        {
            HJGameEventHandler.Instance().OnCurrentLevelPassed -= ShowLevelCompletionUI;
            mLoadNextLevelBtn.onClick.RemoveListener(OnLoadNextLevelClicked);
            DOTween.KillAll();
        }
Exemple #16
0
 //--------------------------------------------------------------------------------------------------------------------------------------------------------
 public void OnRestartSameLevel()
 {
     CurrentGameState = HJGameState.eGamePlaying;
     HJPlayerScoreAndLevelManager.Instance().RestartCurrentLevel();
     HJGameEventHandler.Instance().TriggerRetrySameLevelEvent();
 }
        //----------------------------------------------------------------------------------------------------

        private void OnDisable()
        {
            HJGameEventHandler.Instance().OnScoreChangedEvent -= SetScoreTextInUI;
            HJGameEventHandler.Instance().OnRetrySameLevel    -= ResetUI;
            HJGameEventHandler.Instance().OnNextLevelLoad     += ResetUI;
        }