Ejemplo n.º 1
0
    /**
     * 플레이어 이동 거리 확인 및 TextUI변경 코루틴
     */
    IEnumerator PlayerTravelDistance()
    {
        while (true)
        {
            distance += GetGameSpeed() * (Time.deltaTime * 10);             // 시간 경과에 따라 플레이어 이동거리 추가
            TextUtills.ReflashCommaText(distanceText, (int)distance, " M"); // 이동거리 변경에 따라 UI Text 변경

            if (backgroundColorFlag != (int)(distance * 0.01) % 3)          // 현재 컬러와 이동거리가 다를경우 백그라운드 색 변경
            {
                BackgroundColorChange();
            }

            yield return(new WaitForEndOfFrame());
        }
    }
Ejemplo n.º 2
0
    /**
     * 플레이어 돈이 변경되는 애니메이션 코르틴함수
     */
    IEnumerator MoneyAnimation()
    {
        int saveMoney = DATA.getData().MONEY;

        while (money <= saveMoney)
        {
            yield return(new WaitForSeconds(0.016f));

            int addMoney = money - saveMoney;
            for (int i = 1; addMoney != 0; i += 10)
            {
                money    += 1 * i;
                addMoney /= 10;
            }
            TextUtills.ReflashCommaText(Money, money);
        }
    }
Ejemplo n.º 3
0
    AudioSource AudioSource;        // BGM 관리 오디오

    void Start()
    {
        // 변수 초기화 및 데이터 불러오기
        AudioSource = GetComponent <AudioSource>();
        money       = DATA.getData().MONEY;
        energy      = DATA.getData().ENERGY;
        int bestScore    = DATA.getData().BESTSCORE;
        int bestDistance = DATA.getData().MAXDISTANCE;

        // 에너지 시간 체크
        EnergyTimeCheck();

        // TextUI text 추가
        ReflashEnergyText();
        TextUtills.ReflashCommaText(Money, money);
        TextUtills.ReflashCommaText(BestScore, bestScore);
        TextUtills.ReflashCommaText(BestDistance, bestDistance, " M");

        // 설정창 프레임표시 확인 및 적용
        initSettingMenu();
    }
Ejemplo n.º 4
0
 /**
  * 스코어 추가 함수
  */
 public void AddScore()
 {
     score += 10;
     TextUtills.ReflashCommaText(ScoreText, score);
 }