From f5de84b4eaae6debcea4006dfa52f7ad39b6cb95 Mon Sep 17 00:00:00 2001 From: Jay <96156114+jaydev00a@users.noreply.github.com> Date: Thu, 27 Mar 2025 23:22:49 +0900 Subject: [PATCH] =?UTF-8?q?DO-73=20[Feat]=20=EC=9D=B8=EA=B2=8C=EC=9E=84=20?= =?UTF-8?q?=EC=9D=91=EB=8B=B5=20=EB=A1=9C=EB=94=A9=20=ED=8C=A8=EB=84=90=20?= =?UTF-8?q?=ED=85=8D=EC=8A=A4=ED=8A=B8=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Script/Main/LoadingPanelController.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Assets/Script/Main/LoadingPanelController.cs b/Assets/Script/Main/LoadingPanelController.cs index 306f0b9..91b306f 100644 --- a/Assets/Script/Main/LoadingPanelController.cs +++ b/Assets/Script/Main/LoadingPanelController.cs @@ -16,8 +16,8 @@ public class LoadingPanelController : MonoBehaviour [SerializeField] private Sprite[] dragonSprites; [SerializeField] private Sprite[] tigerSprites; - private string fullText = "불러오는 중..."; - private readonly string[] loadingMessages = { + private string _fullText = "불러오는 중..."; + private readonly string[] _loadingMessages = { "흑돌을 닦는 중...", "백돌을 닦는 중...", "알을 반짝반짝 닦는 중...", @@ -27,6 +27,8 @@ public class LoadingPanelController : MonoBehaviour "흑돌과 백돌을 구분하는 중...", "돌이 동글동글한지 확인하는 중..." }; + + private string _watingText = "상대방을 기다리는 중..."; private float interval = 0.2f; [SerializeField] float flipDuration = 0.3f; // 회전 시간 [SerializeField] float delayBetweenFlips = 1f; // 이미지 변경 주기 @@ -55,6 +57,8 @@ public class LoadingPanelController : MonoBehaviour imageBackground.SetActive(isBackgroundImage); simpleBackground.SetActive(!isBackgroundImage); + _fullText = !isBackgroundImage ? _watingText : _fullText; // 인게임에서 사용하는 경우 맨 처음 텍스트 고정 + if (animatedImage) RotateImages(); // 캐릭터들이 좌우로 회전하는 효과 if (animatedText) StartCoroutine(AnimateLoadingText()); // 한글자씩 나타나는 효과 if (animatedFlip) FlipImages(); // 캐릭터들이 뒤집히면서 표정이 바뀌는 효과 @@ -88,15 +92,15 @@ public class LoadingPanelController : MonoBehaviour while (!cancellationTokenSource.IsCancellationRequested) { // 글자 하나씩 추가 - currentLength = (currentLength + 1) % (fullText.Length + 1); // 글자 하나씩 추가 (0 ~ fullText.Length 반복) - loadingText.text = fullText.Substring(0, currentLength); // 부분 문자열 표시 + currentLength = (currentLength + 1) % (_fullText.Length + 1); // 글자 하나씩 추가 (0 ~ fullText.Length 반복) + loadingText.text = _fullText.Substring(0, currentLength); // 부분 문자열 표시 yield return new WaitForSeconds(interval); // 0.2초마다 변경 // 모든 글자가 다 표시되면 1초 대기 - if (currentLength == fullText.Length) + if (currentLength == _fullText.Length) { yield return new WaitForSeconds(1f); // 1초 대기 - fullText = loadingMessages[Random.Range(0, loadingMessages.Length)]; // 랜덤 메시지 선택 + _fullText = _loadingMessages[Random.Range(0, _loadingMessages.Length)]; // 랜덤 메시지 선택 currentLength = 0; // 다시 처음부터 시작 }