개발일지/TIL
[Unity Devcamp] 0327 개발일지
JangKroed
2023. 3. 28. 18:44
728x90
반응형
초기 앱 설치 후 튜토리얼 완료한 뒤 플레이 화면에서 스코어 갱신이 안되는 문제 개선
- 기존에 BestScore가 없을때 GameObject를 UnEnable상태로 바꾸는 코드에서 0점으로 초기화 하는 함수로 변경
if (BestScoreTxt.text == "") BestScoreTxt.text = "0";
점수가 오르는 도중 점수 오르는 코루틴 함수 실행 시 충돌하는 문제 개선
- 기존에 점수가 오르는 코루틴 함수 실행중 한번 더 실행시 while문으로 인해 순서가 꼬여 코루틴 진행중인지 확인 후 코루틴 실행시키는 함수 추가
private Coroutine scoreCoroutine;
if (scoreCoroutine != null) StopCoroutine(scoreCoroutine);
scoreCoroutine = StartCoroutine(SetScoreUpdate(score, delay));
IEnumerator SetScoreUpdate(int input, float delay)
{
int start = int.Parse(scoreText.text, NumberStyles.AllowThousands);
int best = int.Parse(BestScoreTxt.text, NumberStyles.AllowThousands);
if (start > best) BestScoreTxt.text = string.Format("{0:#,###}", input);
while (input > start)
{
start++;
scoreText.text = string.Format("{0:#,###}", start);
yield return YieldCache.WaitForSeconds(delay);
}
scoreCoroutine = null;
yield return null;
}
[기획추가]
메인메뉴 - 옵션 replay버튼 삭제 및 게임 버전소개 확대
도전모드 게임종료 화면 Welldone, So Cool 추가
- UI 미리보기 및 UI 명세서 확인하여 추가 완료.
Singular Events Test
Firebase Message Test
728x90
반응형