Exemplo n.º 1
0
        //----------------------------------------------------------------------------------------------------

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

            CurrentScore += scoreUnit;
            NumberOfPlatformsPassed++;
            HJGameEventHandler.Instance().TriggerOnScoreChangedEvent(CurrentScore);
        }
Exemplo n.º 2
0
        void SetProgressBarDetails()
        {
            int currentLevel      = HJPlayerScoreAndLevelManager.Instance().CurrentLevel;
            int totalLevelsInGame = HJConfigManager.Instance().GetTotalNumberOfLevelsInGame();

            //mCurrentLevelText.text = currentLevel.ToString();
            //mNextLevelText.text = (currentLevel + 1)> totalLevelsInGame?"": (currentLevel + 1).ToString();

            mCurrentLevelText.text = "0";
            mNextLevelText.text    = "100";


            float completionPercent = (float)(HJPlayerScoreAndLevelManager.Instance().NumberOfPlatformsPassed) / (float)(HJConfigManager.Instance().GetTotalPlatformCountForLevel(currentLevel) - 1);

            mProgressBar.fillAmount = completionPercent;
        }
Exemplo n.º 3
0
        public void InitializePlatformsForLevel()
        {
            mPoleMaterial.material.color = HJConfigManager.Instance().GetPoleColorFor(HJPlayerScoreAndLevelManager.Instance().CurrentLevel);
            int level = HJPlayerScoreAndLevelManager.Instance().CurrentLevel;
            List <HJPlatformDetails> platformDetails = HJConfigManager.Instance().GetPlatformDetailsForLevel(level);
            float initailYPos = HJGameConstants.kFirstPlatformYPos;

            for (int i = 0; i < platformDetails.Count; i++)
            {
                GameObject platfm = GetPlatformGameObject(i);
                platfm.SetActive(true);
                platfm.transform.localPosition = new Vector3(0, initailYPos - (HJConfigManager.Instance().GetDistanceBetweenPlatforms(level) * i), 0);

                platfm.GetComponent <HJPlatFormController>().InitializePlatformForLevel(platformDetails[i], i == platformDetails.Count - 1);
            }
            DeactivateRemainingPaltforms(platformDetails.Count);
        }
        //----------------------------------------------------------------------------------------------------

        void SetStateAndColorToSlice()
        {
            switch (mCurrentSliceType)
            {
            case HJPlatformSliceType.eDisabledSlice:
                this.gameObject.SetActive(false);
                break;

            case HJPlatformSliceType.eDeathSlice:
                mMeshRenderer.material.color = HJConfigManager.Instance().GetDeathPaltformColor(HJPlayerScoreAndLevelManager.Instance().CurrentLevel);
                break;

            case HJPlatformSliceType.eRegularSlice:
                mMeshRenderer.material.color = HJConfigManager.Instance().GetBasePlatformColor(HJPlayerScoreAndLevelManager.Instance().CurrentLevel);
                break;
            }
        }
Exemplo n.º 5
0
 public static HJConfigManager Instance()
 {
     return(mInstance = mInstance == null ? new HJConfigManager() : mInstance);
 }
Exemplo n.º 6
0
        void ShowRetryScreen()
        {
            Time.timeScale = 0.0f;
            mRetryScreen.SetActive(true);
            int   currentLevel      = HJPlayerScoreAndLevelManager.Instance().CurrentLevel;
            float completionPercent = (float)(HJPlayerScoreAndLevelManager.Instance().NumberOfPlatformsPassed) / (float)HJConfigManager.Instance().GetTotalPlatformCountForLevel(currentLevel);

            mCompeletionPercentText.text = string.Format(HJGameConstants.kCompletionPercentText, (int)(completionPercent * 100));
            mRS_BestScoreText.text       = string.Format(HJGameConstants.kRS_BestScoreText, HJPlayerScoreAndLevelManager.Instance().BestScore);
            mTapToRetryText.text         = HJGameConstants.kTapToRetryText;
        }
Exemplo n.º 7
0
        //----------------------------------------------------------------------------------------------------

        public void LoadNextLevel()
        {
            NumberOfPlatformsPassed = 0;
            CurrentLevel            = CurrentLevel + 1 > HJConfigManager.Instance().GetTotalNumberOfLevelsInGame() ? 1 : CurrentLevel + 1;
        }
Exemplo n.º 8
0
 void ResetCameraPos()
 {
     transform.position      = mInitialCameraPos;
     mCamera.backgroundColor = HJConfigManager.Instance().GetBackgroundColorForLevel(HJPlayerScoreAndLevelManager.Instance().CurrentLevel);
 }
Exemplo n.º 9
0
 private void Start()
 {
     mCamera.backgroundColor = HJConfigManager.Instance().GetBackgroundColorForLevel(HJPlayerScoreAndLevelManager.Instance().CurrentLevel);
 }
Exemplo n.º 10
0
 public void ResetBallPosition()
 {
     transform.position = mInitailBallPos;
     mBallMeshRenderer.material.color = HJConfigManager.Instance().GetBallColorFor(HJPlayerScoreAndLevelManager.Instance().CurrentLevel);
 }
Exemplo n.º 11
0
 private void Start()
 {
     mBallMeshRenderer.material.color = HJConfigManager.Instance().GetBallColorFor(HJPlayerScoreAndLevelManager.Instance().CurrentLevel);
 }
 public void LoadNextLevel()
 {
     NumberOfPlatformsPassed = 0;
     CurrentLevel            = CurrentLevel + 1 > HJConfigManager.Instance().GetTotalNumberOfLevelsInGame() ? 1 : CurrentLevel + 1;
     Debug.Log("Next level selected is Next level selected is Next level selected is Next level selected is " + CurrentLevel);
 }