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); }
//---------------------------------------------------------------------------------------------------- public void AddScore() { int scoreUnit = HJConfigManager.Instance().GetScoreUnitForLevel(CurrentLevel); CurrentScore += scoreUnit; NumberOfPlatformsPassed++; HJGameEventHandler.Instance().TriggerOnScoreChangedEvent(CurrentScore); }
//---------------------------------------------------------------------------------------------------- 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; }
public void HandleOnAdClosed(object sender, EventArgs args) { MonoBehaviour.print("HandleAdClosed event received"); RequestInterstitial(); HJGameEventHandler.Instance().TriggerOnAdClosedEvent(); }
public void HandleOnAdFailedToLoad(object sender, AdFailedToLoadEventArgs args) { MonoBehaviour.print("HandleFailedToReceiveAd event received with message: " + args.Message); HJGameEventHandler.Instance().TriggerOnAdFailedToShowEvent(); }
private void OnDisable() { HJGameEventHandler.Instance().OnRetrySameLevel -= ResetCameraPos; HJGameEventHandler.Instance().OnNextLevelLoad -= ResetCameraPos; }
//---------------------------------------------------------------------------------------------------- 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; }
//---------------------------------------------------------------------------------------------------- private void OnDisable() { HJGameEventHandler.Instance().OnCurrentLevelPassed -= ShowLevelCompletionUI; mLoadNextLevelBtn.onClick.RemoveListener(OnLoadNextLevelClicked); DOTween.KillAll(); }
//-------------------------------------------------------------------------------------------------------------------------------------------------------- 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; }