public void Init(bool isClear)
        {
            //이전에 사용된 element삭제
            for (int i = 0; i < this.elements.Count; i++)
            {
                ObjectPoolManager.inst.Return(this.elements[i].gameObject);
            }

            this.elements.Clear();

            this.titleText.text = isClear ? "클리어" : "실패";


            TimeSpan timeSpan   = new TimeSpan(StageMaster.current.scoreInfo.playTicks);
            int      totalScore = 0;

            CreateElement("플레이 타임", string.Format("{0:D2}:{1:D2}", timeSpan.Minutes, timeSpan.Seconds));
            if (isClear && StageMaster.current is TimeAttackStage) // 타임어택
            {
                TimeAttackStage stage = StageMaster.current as TimeAttackStage;

                // 시간 보너스
                int timeBonus = Mathf.CeilToInt((stage.timeLimit - (float)((stage.scoreInfo.endTicks - stage.scoreInfo.startTicks) / TimeSpan.TicksPerSecond)) * 1000);
                CreateElement("시간 보너스", KUtils.GetThousandCommaText(timeBonus));
                totalScore += timeBonus;
            }
            else if (isClear && StageMaster.current is MonsterCleaningStage) // 몬스터 소탕
            {
                MonsterCleaningStage stage = StageMaster.current as MonsterCleaningStage;

                // 처치보너스
                int killMonsterBonus = stage.scoreInfo.killMonster * 1500;
                if (killMonsterBonus > 0)
                {
                    CreateElement("처치 - 일반", KUtils.GetThousandCommaText(killMonsterBonus));
                    totalScore += killMonsterBonus;
                }

                int killBossBonus = stage.scoreInfo.killBoss * 30000;
                if (killBossBonus > 0)
                {
                    CreateElement("처치 - 일반", KUtils.GetThousandCommaText(killBossBonus));
                    totalScore += killBossBonus;
                }
            }

            this.totalScore.text = KUtils.GetThousandCommaText(totalScore);

            // 사운드 재생
            SoundManager.inst.StopBGM();
            if (isClear)
            {
                SoundManager.inst.PlaySound(SoundKeys.EFFECT_VICTORY, PlayerCamera.current.transform, Vector3.zero);
            }
            else
            {
                SoundManager.inst.PlaySound(SoundKeys.EFFECT_GAMEOVER, PlayerCamera.current.transform, Vector3.zero);
            }
        }
Exemple #2
0
        public void UpdateData()
        {
            // 버튼들 활성화 비활성화 여부처리
            this.upButton.interactable    = this.count < MAX_ITEM_COUNT;
            this.downButton.interactable  = this.count > 1;
            this.priceButton.interactable = UserManager.coin >= this.storeInfo.price * count;

            this.countText.text = this.count.ToString();
            this.priceText.text = "$ " + KUtils.GetThousandCommaText(this.storeInfo.price * this.count);
        }
Exemple #3
0
 /// <summary>
 /// 코인량을 업데이트
 /// </summary>
 private void UpdateCoinText()
 {
     this.coinText.text = KUtils.GetThousandCommaText(UserManager.coin);
 }
 public void Init(string itemKey, int reward)
 {
     this.iconImage.overrideSprite = SpriteManager.Get(SpritePath.Item_Path + itemKey);
     this.rewardText.text          = KUtils.GetThousandCommaText(reward);
 }