Update travel HUD and tutorial UI assets
This commit is contained in:
+222
-97
@@ -1,4 +1,3 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
@@ -41,12 +40,16 @@ public class GameManager : MonoBehaviour {
|
||||
private TutorialGuideType tutorialGuideType = TutorialGuideType.None; // 현재 튜토리얼 안내 이미지 종류
|
||||
private string tutorialTitle = ""; // 튜토리얼 안내 제목
|
||||
private string tutorialMessage = ""; // 튜토리얼 안내 문구
|
||||
private Image rightInfoHudBackground; // 오른쪽 거리/마일리지 수하물 라벨 배경
|
||||
private TextMeshProUGUI rightMileageText; // 오른쪽 HUD의 적립 마일리지 텍스트
|
||||
private Image[] lifeIcons; // 왼쪽 HUD의 목숨 도장 표시
|
||||
private GameObject tutorialGuideObject; // 화면 상단 이미지 튜토리얼 패널
|
||||
private Image tutorialMainImage; // 점프/슬라이드 대표 이미지
|
||||
private TextMeshProUGUI tutorialMultiplierText; // 2단 점프 x2 표시
|
||||
private TextMeshProUGUI tutorialTitleText; // 튜토리얼 제목
|
||||
private TextMeshProUGUI tutorialBodyText; // 튜토리얼 설명
|
||||
private Button tutorialNextButton; // 튜토리얼 안내 확인 버튼
|
||||
private TextMeshProUGUI tutorialNextButtonText; // 확인 버튼 텍스트
|
||||
private Image[] tutorialItemImages; // 아이템 순서 설명 이미지
|
||||
private TMP_FontAsset tutorialFontAsset; // 한글 튜토리얼 문구용 런타임 폰트
|
||||
private float tutorialGuideSequenceStartTime; // 튜토리얼 안내 시작 시각
|
||||
@@ -56,9 +59,9 @@ public class GameManager : MonoBehaviour {
|
||||
private float stageElapsedTime = 0f; // 현재 맵 진행 시간
|
||||
private float stageDistance = 0f; // 현재 맵 진행 거리
|
||||
private bool stageCompleted = false; // 결과 화면이 이미 처리되었는지 여부
|
||||
private Coroutine tutorialGuidePauseRoutine; // 안내를 보여주는 동안 잠깐 멈추는 코루틴
|
||||
private bool tutorialGuidePauseActive = false; // 안내 일시정지 중인지 여부
|
||||
private float tutorialGuidePreviousTimeScale = 1f; // 안내 일시정지 전 시간 배율
|
||||
private int tutorialGuideDismissFrame = -1; // 확인 클릭이 플레이 입력으로 이어지지 않게 막는 프레임
|
||||
private int tutorialGuideVersion = 0; // 오래된 자동 숨김 요청을 무시하기 위한 버전
|
||||
private FinishGate activeFinishGate; // 목표 지점에 나타나는 맵별 클리어 게이트
|
||||
private bool finishGateSpawned = false; // 현재 맵에서 도착 게이트를 이미 만들었는지 여부
|
||||
@@ -70,7 +73,7 @@ public class GameManager : MonoBehaviour {
|
||||
public bool saveMileageImmediately = true; // 스테이지 정산 전까지는 획득 즉시 누적한다.
|
||||
public bool playTutorialGuideSequence = false; // 코스 데이터가 없을 때만 시간 기준 안내를 보여준다.
|
||||
public bool pauseGameplayForTutorialGuide = true; // 안내가 뜨는 동안 게임을 잠깐 멈춘다.
|
||||
public float tutorialGuidePauseDuration = 2f; // 안내를 보여주고 자동으로 숨길 시간
|
||||
public float tutorialGuidePauseDuration = 2f; // 이전 자동 숨김 시간 값입니다. 현재 안내는 확인 클릭으로만 닫습니다.
|
||||
public float itemInvincibleDuration = 2.2f; // 라멘 아이템 무적 지속 시간
|
||||
public float itemSpeedBoostAmount = 0.35f; // 운동화 아이템 즉시 속도 보정량
|
||||
public float mileageBonusDuration = 7f; // 마일리지 카드 보너스 지속 시간
|
||||
@@ -82,14 +85,29 @@ public class GameManager : MonoBehaviour {
|
||||
|
||||
private const string TotalMileageKey = "UniRun.TotalMileage";
|
||||
private const string InitialMileageGrantedKey = "UniRun.InitialMileageGranted";
|
||||
private const string CharacterFaceResourcePath = "UI_JJ_Face";
|
||||
private const string PassportPanelResourcePath = "UI_PassportPanel";
|
||||
private const string CharacterFaceResourcePath = "UI_JJ_PassportPhoto";
|
||||
private const string PassportPanelResourcePath = "UI_LeftHudPassportHorizontalGridPanel";
|
||||
private const string LifeStampResourcePath = "UI_LifeStamp";
|
||||
private const string PassportItemSlotResourcePath = "UI_PassportItemSlot";
|
||||
private const string TutorialGuideFrameResourcePath = "UI_TutorialAirportMonitorFrame";
|
||||
private const string TutorialNextButtonResourcePath = "UI_TutorialNextButton";
|
||||
private const string RightHudLuggageLabelKoreaResourcePath = "UI_RightHudLuggageLabel_Korea";
|
||||
private const string RightHudLuggageLabelJapanResourcePath = "UI_RightHudLuggageLabel_Japan";
|
||||
private const string RightHudLuggageLabelChinaResourcePath = "UI_RightHudLuggageLabel_China";
|
||||
private const string RightHudLuggageLabelAmericaResourcePath = "UI_RightHudLuggageLabel_America";
|
||||
private const float PassportHudWidth = 320f;
|
||||
private const float PassportHudHeight = 102f;
|
||||
private const float PassportHudScale = 0.5f;
|
||||
private const float RightInfoHudWidth = 260f;
|
||||
private const float RightInfoHudHeight = 64f;
|
||||
private const float RightInfoHudScale = 0.6f;
|
||||
private const float TutorialJumpGuideDuration = 3.5f;
|
||||
private const float TutorialDoubleJumpGuideDuration = 3.5f;
|
||||
private const float TutorialSlideGuideDuration = 3.5f;
|
||||
private const float TutorialItemGuideDuration = 5.2f;
|
||||
private const float TutorialGuideWidth = 392f;
|
||||
private const float TutorialGuideHeight = 142f;
|
||||
private const float TutorialGuideScale = 0.6f;
|
||||
|
||||
// 게임의 스피드를 올리는 변수
|
||||
public float gameSpeed = 1f;
|
||||
@@ -102,7 +120,7 @@ public class GameManager : MonoBehaviour {
|
||||
private float mileageBonusEndTime = 0f; // 마일리지 카드 보너스 종료 시각
|
||||
|
||||
public bool IsTutorialGuidePaused {
|
||||
get { return tutorialGuidePauseActive; }
|
||||
get { return tutorialGuidePauseActive || tutorialGuideDismissFrame == Time.frameCount; }
|
||||
}
|
||||
|
||||
// 게임 시작과 동시에 싱글톤을 구성
|
||||
@@ -200,6 +218,7 @@ public class GameManager : MonoBehaviour {
|
||||
? mapDefinition
|
||||
: MapDatabase.GetMap(MapId.TutorialIncheon);
|
||||
BackgroundLoop.ApplyResourceBackground(currentMapDefinition.backgroundResourcePath);
|
||||
UpdateRightInfoHudSkin();
|
||||
|
||||
score = 0;
|
||||
stageMileage = 0;
|
||||
@@ -262,7 +281,7 @@ public class GameManager : MonoBehaviour {
|
||||
}
|
||||
|
||||
UpdateScoreUI();
|
||||
TryPauseForTutorialGuide(tutorialGuideVersion);
|
||||
TryPauseForTutorialGuide();
|
||||
}
|
||||
|
||||
private bool HasTutorialGuideContent(TutorialGuideType guideType, string title, string message) {
|
||||
@@ -271,9 +290,8 @@ public class GameManager : MonoBehaviour {
|
||||
|| !string.IsNullOrEmpty(message);
|
||||
}
|
||||
|
||||
private void TryPauseForTutorialGuide(int guideVersion) {
|
||||
private void TryPauseForTutorialGuide() {
|
||||
if(!pauseGameplayForTutorialGuide
|
||||
|| tutorialGuidePauseDuration <= 0f
|
||||
|| isGameover
|
||||
|| !GameFlowManager.IsGameplayActive)
|
||||
{
|
||||
@@ -288,38 +306,20 @@ public class GameManager : MonoBehaviour {
|
||||
|
||||
Time.timeScale = 0f;
|
||||
|
||||
if(tutorialGuidePauseRoutine != null)
|
||||
{
|
||||
StopCoroutine(tutorialGuidePauseRoutine);
|
||||
}
|
||||
|
||||
tutorialGuidePauseRoutine = StartCoroutine(HideTutorialGuideAfterPause(guideVersion));
|
||||
}
|
||||
|
||||
private IEnumerator HideTutorialGuideAfterPause(int guideVersion) {
|
||||
yield return new WaitForSecondsRealtime(tutorialGuidePauseDuration);
|
||||
|
||||
tutorialGuidePauseRoutine = null;
|
||||
|
||||
if(guideVersion == tutorialGuideVersion)
|
||||
{
|
||||
tutorialGuideVersion++;
|
||||
tutorialGuideType = TutorialGuideType.None;
|
||||
tutorialTitle = "";
|
||||
tutorialMessage = "";
|
||||
UpdateScoreUI();
|
||||
}
|
||||
private void CompleteTutorialGuideByClick() {
|
||||
tutorialGuideVersion++;
|
||||
tutorialGuideType = TutorialGuideType.None;
|
||||
tutorialTitle = "";
|
||||
tutorialMessage = "";
|
||||
tutorialGuideDismissFrame = Time.frameCount;
|
||||
UpdateScoreUI();
|
||||
|
||||
RestoreTutorialGuideTimeScale();
|
||||
}
|
||||
|
||||
private void StopTutorialGuidePause(bool restoreTimeScale) {
|
||||
if(tutorialGuidePauseRoutine != null)
|
||||
{
|
||||
StopCoroutine(tutorialGuidePauseRoutine);
|
||||
tutorialGuidePauseRoutine = null;
|
||||
}
|
||||
|
||||
if(restoreTimeScale)
|
||||
{
|
||||
RestoreTutorialGuideTimeScale();
|
||||
@@ -703,21 +703,16 @@ public class GameManager : MonoBehaviour {
|
||||
private void UpdateScoreUI() {
|
||||
if(scoreText != null)
|
||||
{
|
||||
string mapName = currentMapDefinition != null ? currentMapDefinition.displayName : "RUN";
|
||||
string distanceText = currentMapDefinition != null
|
||||
? Mathf.FloorToInt(stageDistance) + "/" + Mathf.FloorToInt(currentMapDefinition.targetDistance) + "m"
|
||||
: Mathf.FloorToInt(stageDistance) + "m";
|
||||
string timeText = currentMapDefinition != null && currentMapDefinition.timeLimit > 0f
|
||||
? Mathf.Max(0f, currentMapDefinition.timeLimit - stageElapsedTime).ToString("0") + "s"
|
||||
: stageElapsedTime.ToString("0") + "s";
|
||||
|
||||
scoreText.text = mapName
|
||||
+ "\nSCORE " + score
|
||||
+ "\nMILE " + stageMileage
|
||||
+ "\nTOTAL " + totalMileage
|
||||
+ "\nDIST " + distanceText
|
||||
+ "\nTIME " + timeText
|
||||
+ "\nSPD " + gameSpeed.ToString("0.0");
|
||||
scoreText.text = "DIST\n" + distanceText;
|
||||
}
|
||||
|
||||
if(rightMileageText != null)
|
||||
{
|
||||
rightMileageText.text = "MILE\n" + stageMileage;
|
||||
}
|
||||
|
||||
if(lifeIcons != null)
|
||||
@@ -792,27 +787,32 @@ public class GameManager : MonoBehaviour {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(tutorialNextButton != null)
|
||||
{
|
||||
tutorialNextButton.gameObject.SetActive(hasGuide);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateTutorialTextLayout(bool showItemRow, bool showFullText) {
|
||||
Vector2 textPosition = new Vector2(66f, -8f);
|
||||
Vector2 textSize = new Vector2(268f, 17f);
|
||||
Vector2 bodyPosition = new Vector2(66f, -26f);
|
||||
Vector2 bodySize = new Vector2(268f, 31f);
|
||||
Vector2 textPosition = new Vector2(104f, -38f);
|
||||
Vector2 textSize = new Vector2(250f, 20f);
|
||||
Vector2 bodyPosition = new Vector2(104f, -60f);
|
||||
Vector2 bodySize = new Vector2(250f, 38f);
|
||||
|
||||
if(showItemRow)
|
||||
{
|
||||
textPosition = new Vector2(80f, -8f);
|
||||
textSize = new Vector2(252f, 17f);
|
||||
bodyPosition = new Vector2(80f, -26f);
|
||||
bodySize = new Vector2(252f, 31f);
|
||||
textPosition = new Vector2(110f, -38f);
|
||||
textSize = new Vector2(242f, 20f);
|
||||
bodyPosition = new Vector2(110f, -60f);
|
||||
bodySize = new Vector2(242f, 38f);
|
||||
}
|
||||
else if(showFullText)
|
||||
{
|
||||
textPosition = new Vector2(16f, -8f);
|
||||
textSize = new Vector2(316f, 17f);
|
||||
bodyPosition = new Vector2(16f, -26f);
|
||||
bodySize = new Vector2(316f, 31f);
|
||||
textPosition = new Vector2(54f, -39f);
|
||||
textSize = new Vector2(284f, 20f);
|
||||
bodyPosition = new Vector2(54f, -61f);
|
||||
bodySize = new Vector2(284f, 39f);
|
||||
}
|
||||
|
||||
if(tutorialTitleText != null)
|
||||
@@ -888,25 +888,89 @@ public class GameManager : MonoBehaviour {
|
||||
|
||||
Transform canvasTransform = scoreText.transform.parent;
|
||||
|
||||
ConfigureRightInfoText();
|
||||
CreateRightInfoHUD(canvasTransform);
|
||||
CreateStatusHUD(canvasTransform);
|
||||
CreateTutorialGuide(canvasTransform);
|
||||
}
|
||||
|
||||
private void ConfigureRightInfoText() {
|
||||
RectTransform rectTransform = scoreText.rectTransform;
|
||||
rectTransform.anchorMin = new Vector2(1f, 1f);
|
||||
rectTransform.anchorMax = new Vector2(1f, 1f);
|
||||
rectTransform.pivot = new Vector2(1f, 1f);
|
||||
rectTransform.anchoredPosition = new Vector2(-12f, -9f);
|
||||
rectTransform.sizeDelta = new Vector2(176f, 96f);
|
||||
private void CreateRightInfoHUD(Transform canvasTransform) {
|
||||
GameObject hudObject = new GameObject("Right Luggage HUD", typeof(RectTransform), typeof(CanvasRenderer), typeof(Image));
|
||||
hudObject.transform.SetParent(canvasTransform, false);
|
||||
|
||||
scoreText.alignment = TextAlignmentOptions.TopRight;
|
||||
scoreText.fontSize = 8.5f;
|
||||
scoreText.lineSpacing = -13f;
|
||||
scoreText.color = new Color(0.94f, 0.97f, 1f, 0.92f);
|
||||
scoreText.raycastTarget = false;
|
||||
scoreText.textWrappingMode = TextWrappingModes.NoWrap;
|
||||
RectTransform hudRect = hudObject.GetComponent<RectTransform>();
|
||||
hudRect.anchorMin = new Vector2(1f, 1f);
|
||||
hudRect.anchorMax = new Vector2(1f, 1f);
|
||||
hudRect.pivot = new Vector2(1f, 1f);
|
||||
hudRect.anchoredPosition = new Vector2(-10f, -8f);
|
||||
hudRect.sizeDelta = new Vector2(RightInfoHudWidth * RightInfoHudScale, RightInfoHudHeight * RightInfoHudScale);
|
||||
hudRect.localScale = Vector3.one;
|
||||
|
||||
rightInfoHudBackground = hudObject.GetComponent<Image>();
|
||||
rightInfoHudBackground.preserveAspect = false;
|
||||
rightInfoHudBackground.raycastTarget = false;
|
||||
UpdateRightInfoHudSkin();
|
||||
|
||||
scoreText.gameObject.name = "Distance Text";
|
||||
scoreText.transform.SetParent(hudObject.transform, false);
|
||||
ConfigureRightInfoText(scoreText, new Vector2(0.29f, 0.18f), new Vector2(0.61f, 0.74f));
|
||||
|
||||
GameObject mileageObject = new GameObject("Mileage Text", typeof(RectTransform), typeof(CanvasRenderer));
|
||||
mileageObject.transform.SetParent(hudObject.transform, false);
|
||||
rightMileageText = mileageObject.AddComponent<TextMeshProUGUI>();
|
||||
rightMileageText.font = scoreText.font;
|
||||
ConfigureRightInfoText(rightMileageText, new Vector2(0.62f, 0.18f), new Vector2(0.95f, 0.74f));
|
||||
}
|
||||
|
||||
private void ConfigureRightInfoText(TextMeshProUGUI text, Vector2 anchorMin, Vector2 anchorMax) {
|
||||
RectTransform rectTransform = text.rectTransform;
|
||||
rectTransform.anchorMin = anchorMin;
|
||||
rectTransform.anchorMax = anchorMax;
|
||||
rectTransform.offsetMin = Vector2.zero;
|
||||
rectTransform.offsetMax = Vector2.zero;
|
||||
rectTransform.localScale = Vector3.one;
|
||||
|
||||
text.alignment = TextAlignmentOptions.Center;
|
||||
text.fontSize = 9f;
|
||||
text.enableAutoSizing = true;
|
||||
text.fontSizeMin = 6.5f;
|
||||
text.fontSizeMax = 10f;
|
||||
text.lineSpacing = -7f;
|
||||
text.color = new Color(0.015f, 0.045f, 0.085f, 1f);
|
||||
text.fontStyle = FontStyles.Bold;
|
||||
text.raycastTarget = false;
|
||||
text.textWrappingMode = TextWrappingModes.NoWrap;
|
||||
}
|
||||
|
||||
private void UpdateRightInfoHudSkin() {
|
||||
if(rightInfoHudBackground == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
rightInfoHudBackground.sprite = LoadHudSprite(GetRightInfoHudResourcePath());
|
||||
rightInfoHudBackground.color = rightInfoHudBackground.sprite != null
|
||||
? Color.white
|
||||
: new Color(0.95f, 0.97f, 1f, 0.88f);
|
||||
}
|
||||
|
||||
private string GetRightInfoHudResourcePath() {
|
||||
if(currentMapDefinition == null)
|
||||
{
|
||||
return RightHudLuggageLabelKoreaResourcePath;
|
||||
}
|
||||
|
||||
switch(currentMapDefinition.mapId)
|
||||
{
|
||||
case MapId.Japan:
|
||||
return RightHudLuggageLabelJapanResourcePath;
|
||||
case MapId.China:
|
||||
return RightHudLuggageLabelChinaResourcePath;
|
||||
case MapId.America:
|
||||
return RightHudLuggageLabelAmericaResourcePath;
|
||||
case MapId.TutorialIncheon:
|
||||
default:
|
||||
return RightHudLuggageLabelKoreaResourcePath;
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateStatusHUD(Transform canvasTransform) {
|
||||
@@ -917,14 +981,16 @@ public class GameManager : MonoBehaviour {
|
||||
hudRect.anchorMin = new Vector2(0f, 1f);
|
||||
hudRect.anchorMax = new Vector2(0f, 1f);
|
||||
hudRect.pivot = new Vector2(0f, 1f);
|
||||
hudRect.anchoredPosition = new Vector2(8f, -7f);
|
||||
hudRect.sizeDelta = new Vector2(108f, 34f);
|
||||
hudRect.anchoredPosition = new Vector2(10f, -8f);
|
||||
hudRect.sizeDelta = new Vector2(PassportHudWidth, PassportHudHeight);
|
||||
hudRect.localScale = Vector3.one * PassportHudScale;
|
||||
|
||||
Image hudBackground = hudObject.GetComponent<Image>();
|
||||
hudBackground.sprite = LoadHudSprite(PassportPanelResourcePath);
|
||||
hudBackground.color = hudBackground.sprite != null
|
||||
? Color.white
|
||||
: new Color(0.04f, 0.08f, 0.11f, 0.68f);
|
||||
hudBackground.preserveAspect = true;
|
||||
hudBackground.raycastTarget = false;
|
||||
|
||||
CreateFaceIcon(hudObject.transform);
|
||||
@@ -940,11 +1006,11 @@ public class GameManager : MonoBehaviour {
|
||||
frameRect.anchorMin = new Vector2(0f, 1f);
|
||||
frameRect.anchorMax = new Vector2(0f, 1f);
|
||||
frameRect.pivot = new Vector2(0f, 1f);
|
||||
frameRect.anchoredPosition = new Vector2(6f, -6f);
|
||||
frameRect.sizeDelta = new Vector2(20f, 20f);
|
||||
frameRect.anchoredPosition = new Vector2(30f, -20f);
|
||||
frameRect.sizeDelta = new Vector2(72f, 68f);
|
||||
|
||||
Image frameImage = faceFrame.GetComponent<Image>();
|
||||
frameImage.color = new Color(0.12f, 0.16f, 0.17f, 0.36f);
|
||||
frameImage.color = new Color(1f, 1f, 1f, 0f);
|
||||
frameImage.raycastTarget = false;
|
||||
|
||||
GameObject faceObject = new GameObject("Character Face", typeof(RectTransform), typeof(CanvasRenderer), typeof(Image));
|
||||
@@ -979,8 +1045,8 @@ public class GameManager : MonoBehaviour {
|
||||
lifeRect.anchorMin = new Vector2(0f, 1f);
|
||||
lifeRect.anchorMax = new Vector2(0f, 1f);
|
||||
lifeRect.pivot = new Vector2(0f, 1f);
|
||||
lifeRect.anchoredPosition = new Vector2(33f + (i * 13f), -7f);
|
||||
lifeRect.sizeDelta = new Vector2(10f, 10f);
|
||||
lifeRect.anchoredPosition = new Vector2(124f + (i * 44f), -20f);
|
||||
lifeRect.sizeDelta = new Vector2(30f, 30f);
|
||||
|
||||
Image lifeImage = lifeObject.GetComponent<Image>();
|
||||
lifeImage.sprite = lifeSprite;
|
||||
@@ -1005,15 +1071,15 @@ public class GameManager : MonoBehaviour {
|
||||
slotRect.anchorMin = new Vector2(0f, 1f);
|
||||
slotRect.anchorMax = new Vector2(0f, 1f);
|
||||
slotRect.pivot = new Vector2(0f, 1f);
|
||||
slotRect.anchoredPosition = new Vector2(33f + (i * 13f), -20f);
|
||||
slotRect.sizeDelta = new Vector2(10f, 10f);
|
||||
slotRect.anchoredPosition = new Vector2(118f + (i * 46f), -66f);
|
||||
slotRect.sizeDelta = new Vector2(40f, 24f);
|
||||
|
||||
Image slotImage = slotObject.GetComponent<Image>();
|
||||
slotImage.sprite = slotSprite;
|
||||
slotImage.color = slotSprite != null
|
||||
? new Color(1f, 1f, 1f, 0.92f)
|
||||
? new Color(1f, 1f, 1f, 0.62f)
|
||||
: new Color(0.92f, 0.97f, 1f, 0.22f);
|
||||
slotImage.preserveAspect = true;
|
||||
slotImage.preserveAspect = false;
|
||||
slotImage.raycastTarget = false;
|
||||
}
|
||||
}
|
||||
@@ -1058,19 +1124,27 @@ public class GameManager : MonoBehaviour {
|
||||
guideRect.anchorMin = new Vector2(0.5f, 1f);
|
||||
guideRect.anchorMax = new Vector2(0.5f, 1f);
|
||||
guideRect.pivot = new Vector2(0.5f, 1f);
|
||||
guideRect.anchoredPosition = new Vector2(0f, -12f);
|
||||
guideRect.sizeDelta = new Vector2(348f, 66f);
|
||||
guideRect.anchoredPosition = new Vector2(0f, -10f);
|
||||
guideRect.sizeDelta = new Vector2(TutorialGuideWidth, TutorialGuideHeight);
|
||||
guideRect.localScale = Vector3.one * TutorialGuideScale;
|
||||
|
||||
Image guideBackground = tutorialGuideObject.GetComponent<Image>();
|
||||
guideBackground.color = new Color(0.035f, 0.055f, 0.07f, 0.82f);
|
||||
guideBackground.sprite = LoadHudSprite(TutorialGuideFrameResourcePath);
|
||||
guideBackground.color = guideBackground.sprite != null
|
||||
? Color.white
|
||||
: new Color(0.035f, 0.055f, 0.07f, 0.82f);
|
||||
guideBackground.preserveAspect = false;
|
||||
guideBackground.raycastTarget = false;
|
||||
|
||||
tutorialFontAsset = CreateKoreanTutorialFontAsset();
|
||||
|
||||
CreateTutorialMainImage(tutorialGuideObject.transform);
|
||||
CreateTutorialItemRow(tutorialGuideObject.transform);
|
||||
tutorialTitleText = CreateTutorialText(tutorialGuideObject.transform, "Tutorial Title", new Vector2(66f, -8f), new Vector2(268f, 17f), 11.5f, FontStyles.Bold);
|
||||
tutorialBodyText = CreateTutorialText(tutorialGuideObject.transform, "Tutorial Body", new Vector2(66f, -26f), new Vector2(268f, 31f), 8.5f, FontStyles.Normal);
|
||||
tutorialTitleText = CreateTutorialText(tutorialGuideObject.transform, "Tutorial Title", new Vector2(104f, -38f), new Vector2(250f, 20f), 12f, FontStyles.Bold);
|
||||
tutorialBodyText = CreateTutorialText(tutorialGuideObject.transform, "Tutorial Body", new Vector2(104f, -60f), new Vector2(250f, 38f), 9f, FontStyles.Normal);
|
||||
tutorialTitleText.color = new Color(0.06f, 0.13f, 0.19f, 0.98f);
|
||||
tutorialBodyText.color = new Color(0.10f, 0.18f, 0.23f, 0.95f);
|
||||
CreateTutorialNextButton(tutorialGuideObject.transform);
|
||||
tutorialGuideObject.SetActive(false);
|
||||
}
|
||||
|
||||
@@ -1079,11 +1153,11 @@ public class GameManager : MonoBehaviour {
|
||||
imageObject.transform.SetParent(parent, false);
|
||||
|
||||
RectTransform imageRect = imageObject.GetComponent<RectTransform>();
|
||||
imageRect.anchorMin = new Vector2(0f, 0.5f);
|
||||
imageRect.anchorMax = new Vector2(0f, 0.5f);
|
||||
imageRect.pivot = new Vector2(0f, 0.5f);
|
||||
imageRect.anchoredPosition = new Vector2(14f, 0f);
|
||||
imageRect.sizeDelta = new Vector2(48f, 48f);
|
||||
imageRect.anchorMin = new Vector2(0f, 1f);
|
||||
imageRect.anchorMax = new Vector2(0f, 1f);
|
||||
imageRect.pivot = new Vector2(0f, 1f);
|
||||
imageRect.anchoredPosition = new Vector2(42f, -54f);
|
||||
imageRect.sizeDelta = new Vector2(50f, 50f);
|
||||
|
||||
tutorialMainImage = imageObject.GetComponent<Image>();
|
||||
tutorialMainImage.preserveAspect = true;
|
||||
@@ -1128,11 +1202,11 @@ public class GameManager : MonoBehaviour {
|
||||
itemObject.transform.SetParent(parent, false);
|
||||
|
||||
RectTransform itemRect = itemObject.GetComponent<RectTransform>();
|
||||
itemRect.anchorMin = new Vector2(0f, 0.5f);
|
||||
itemRect.anchorMax = new Vector2(0f, 0.5f);
|
||||
itemRect.pivot = new Vector2(0f, 0.5f);
|
||||
itemRect.anchoredPosition = new Vector2(14f, 0f);
|
||||
itemRect.sizeDelta = new Vector2(54f, 54f);
|
||||
itemRect.anchorMin = new Vector2(0f, 1f);
|
||||
itemRect.anchorMax = new Vector2(0f, 1f);
|
||||
itemRect.pivot = new Vector2(0f, 1f);
|
||||
itemRect.anchoredPosition = new Vector2(38f, -50f);
|
||||
itemRect.sizeDelta = new Vector2(58f, 58f);
|
||||
|
||||
Image itemImage = itemObject.GetComponent<Image>();
|
||||
itemImage.sprite = LoadTutorialSprite(itemAssetPaths[i]);
|
||||
@@ -1143,6 +1217,57 @@ public class GameManager : MonoBehaviour {
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateTutorialNextButton(Transform parent) {
|
||||
GameObject buttonObject = new GameObject("Tutorial Confirm Button", typeof(RectTransform), typeof(CanvasRenderer), typeof(Image), typeof(Button));
|
||||
buttonObject.transform.SetParent(parent, false);
|
||||
|
||||
RectTransform buttonRect = buttonObject.GetComponent<RectTransform>();
|
||||
buttonRect.anchorMin = new Vector2(0f, 1f);
|
||||
buttonRect.anchorMax = new Vector2(0f, 1f);
|
||||
buttonRect.pivot = new Vector2(0f, 1f);
|
||||
buttonRect.anchoredPosition = new Vector2(244f, -103f);
|
||||
buttonRect.sizeDelta = new Vector2(112f, 30f);
|
||||
|
||||
Image buttonImage = buttonObject.GetComponent<Image>();
|
||||
buttonImage.sprite = LoadHudSprite(TutorialNextButtonResourcePath);
|
||||
buttonImage.color = buttonImage.sprite != null
|
||||
? Color.white
|
||||
: new Color(0.03f, 0.13f, 0.20f, 0.92f);
|
||||
buttonImage.preserveAspect = false;
|
||||
buttonImage.raycastTarget = true;
|
||||
|
||||
tutorialNextButton = buttonObject.GetComponent<Button>();
|
||||
tutorialNextButton.targetGraphic = buttonImage;
|
||||
tutorialNextButton.onClick.AddListener(CompleteTutorialGuideByClick);
|
||||
|
||||
ColorBlock colors = tutorialNextButton.colors;
|
||||
colors.normalColor = Color.white;
|
||||
colors.highlightedColor = new Color(1f, 1f, 1f, 0.92f);
|
||||
colors.pressedColor = new Color(0.78f, 0.92f, 1f, 0.95f);
|
||||
colors.selectedColor = colors.highlightedColor;
|
||||
colors.disabledColor = new Color(1f, 1f, 1f, 0.35f);
|
||||
tutorialNextButton.colors = colors;
|
||||
|
||||
GameObject textObject = new GameObject("Tutorial Confirm Text", typeof(RectTransform), typeof(CanvasRenderer));
|
||||
textObject.transform.SetParent(buttonObject.transform, false);
|
||||
|
||||
RectTransform textRect = textObject.GetComponent<RectTransform>();
|
||||
textRect.anchorMin = Vector2.zero;
|
||||
textRect.anchorMax = Vector2.one;
|
||||
textRect.offsetMin = new Vector2(34f, 4f);
|
||||
textRect.offsetMax = new Vector2(-10f, -4f);
|
||||
|
||||
tutorialNextButtonText = textObject.AddComponent<TextMeshProUGUI>();
|
||||
tutorialNextButtonText.font = tutorialFontAsset != null ? tutorialFontAsset : scoreText.font;
|
||||
tutorialNextButtonText.text = "확인";
|
||||
tutorialNextButtonText.alignment = TextAlignmentOptions.Center;
|
||||
tutorialNextButtonText.fontSize = 9f;
|
||||
tutorialNextButtonText.fontStyle = FontStyles.Bold;
|
||||
tutorialNextButtonText.color = new Color(0.92f, 0.98f, 1f, 0.98f);
|
||||
tutorialNextButtonText.raycastTarget = false;
|
||||
tutorialNextButtonText.textWrappingMode = TextWrappingModes.NoWrap;
|
||||
}
|
||||
|
||||
private TextMeshProUGUI CreateTutorialText(Transform parent, string objectName, Vector2 anchoredPosition, Vector2 sizeDelta, float fontSize, FontStyles fontStyle) {
|
||||
GameObject textObject = new GameObject(objectName, typeof(RectTransform), typeof(CanvasRenderer));
|
||||
textObject.transform.SetParent(parent, false);
|
||||
|
||||
Reference in New Issue
Block a user