Tune tutorial coin arcs and finish flow
This commit is contained in:
@@ -62,6 +62,7 @@ public class GameManager : MonoBehaviour {
|
||||
private int tutorialGuideVersion = 0; // 오래된 자동 숨김 요청을 무시하기 위한 버전
|
||||
private FinishGate activeFinishGate; // 목표 지점에 나타나는 맵별 클리어 게이트
|
||||
private bool finishGateSpawned = false; // 현재 맵에서 도착 게이트를 이미 만들었는지 여부
|
||||
private PlatformSpawner activePlatformSpawner; // 현재 맵의 발판/장애물 생성기
|
||||
|
||||
public int maxLife = 3; // 시작 목숨
|
||||
public int initialMileage = 500; // 첫 시작시 지급할 초기 마일리지
|
||||
@@ -222,10 +223,10 @@ public class GameManager : MonoBehaviour {
|
||||
gameoverUI.SetActive(false);
|
||||
}
|
||||
|
||||
PlatformSpawner platformSpawner = FindFirstObjectByType<PlatformSpawner>();
|
||||
if(platformSpawner != null)
|
||||
activePlatformSpawner = FindFirstObjectByType<PlatformSpawner>();
|
||||
if(activePlatformSpawner != null)
|
||||
{
|
||||
platformSpawner.ApplyMap(currentMapDefinition);
|
||||
activePlatformSpawner.ApplyMap(currentMapDefinition);
|
||||
}
|
||||
|
||||
StartTutorialGuideSequence();
|
||||
@@ -646,11 +647,31 @@ public class GameManager : MonoBehaviour {
|
||||
return;
|
||||
}
|
||||
|
||||
float gateGroundY = finishGateGroundY;
|
||||
EnsureFinishGateLanding(gateGroundY);
|
||||
|
||||
GameObject gateObject = new GameObject("Finish Gate - " + currentMapDefinition.displayName);
|
||||
gateObject.transform.position = new Vector3(finishGateSpawnX, finishGateGroundY, 0f);
|
||||
gateObject.transform.position = new Vector3(finishGateSpawnX, gateGroundY, 0f);
|
||||
activeFinishGate = gateObject.AddComponent<FinishGate>();
|
||||
activeFinishGate.Setup(currentMapDefinition.finishGateStyle);
|
||||
finishGateSpawned = true;
|
||||
|
||||
if(activePlatformSpawner != null)
|
||||
{
|
||||
activePlatformSpawner.StopCourseSpawningAfterFinishGate();
|
||||
}
|
||||
}
|
||||
|
||||
private void EnsureFinishGateLanding(float gateGroundY) {
|
||||
if(activePlatformSpawner == null)
|
||||
{
|
||||
activePlatformSpawner = FindFirstObjectByType<PlatformSpawner>();
|
||||
}
|
||||
|
||||
if(activePlatformSpawner != null)
|
||||
{
|
||||
activePlatformSpawner.SpawnFinishLandingPlatform(finishGateSpawnX, gateGroundY);
|
||||
}
|
||||
}
|
||||
|
||||
private bool ShouldUseFinishGate() {
|
||||
@@ -665,6 +686,11 @@ public class GameManager : MonoBehaviour {
|
||||
Destroy(activeFinishGate.gameObject);
|
||||
activeFinishGate = null;
|
||||
}
|
||||
|
||||
if(activePlatformSpawner != null)
|
||||
{
|
||||
activePlatformSpawner.ClearFinishLandingPlatform();
|
||||
}
|
||||
}
|
||||
|
||||
private void SyncTotalMileageToFlow() {
|
||||
@@ -739,14 +765,15 @@ public class GameManager : MonoBehaviour {
|
||||
tutorialBodyText.text = tutorialMessage;
|
||||
}
|
||||
|
||||
bool showItemRow = tutorialGuideType == TutorialGuideType.Items;
|
||||
Sprite mainSprite = GetTutorialMainSprite(tutorialGuideType);
|
||||
bool showFullText = !showItemRow && mainSprite == null;
|
||||
UpdateTutorialTextLayout(showItemRow, showFullText);
|
||||
int activeItemImageIndex = GetTutorialItemImageIndex();
|
||||
bool showItemImage = tutorialGuideType == TutorialGuideType.Items && HasTutorialItemImage(activeItemImageIndex);
|
||||
Sprite mainSprite = showItemImage ? null : GetTutorialMainSprite(tutorialGuideType);
|
||||
bool showFullText = !showItemImage && mainSprite == null;
|
||||
UpdateTutorialTextLayout(showItemImage, showFullText);
|
||||
|
||||
if(tutorialMainImage != null)
|
||||
{
|
||||
tutorialMainImage.gameObject.SetActive(!showItemRow && mainSprite != null);
|
||||
tutorialMainImage.gameObject.SetActive(!showItemImage && mainSprite != null);
|
||||
tutorialMainImage.sprite = mainSprite;
|
||||
}
|
||||
|
||||
@@ -761,7 +788,7 @@ public class GameManager : MonoBehaviour {
|
||||
{
|
||||
if(tutorialItemImages[i] != null)
|
||||
{
|
||||
tutorialItemImages[i].gameObject.SetActive(showItemRow && tutorialItemImages[i].sprite != null);
|
||||
tutorialItemImages[i].gameObject.SetActive(showItemImage && i == activeItemImageIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -775,10 +802,10 @@ public class GameManager : MonoBehaviour {
|
||||
|
||||
if(showItemRow)
|
||||
{
|
||||
textPosition = new Vector2(154f, -8f);
|
||||
textSize = new Vector2(178f, 17f);
|
||||
bodyPosition = new Vector2(154f, -26f);
|
||||
bodySize = new Vector2(178f, 31f);
|
||||
textPosition = new Vector2(80f, -8f);
|
||||
textSize = new Vector2(252f, 17f);
|
||||
bodyPosition = new Vector2(80f, -26f);
|
||||
bodySize = new Vector2(252f, 31f);
|
||||
}
|
||||
else if(showFullText)
|
||||
{
|
||||
@@ -801,6 +828,49 @@ public class GameManager : MonoBehaviour {
|
||||
}
|
||||
}
|
||||
|
||||
private bool HasTutorialItemImage(int itemImageIndex) {
|
||||
return tutorialItemImages != null
|
||||
&& itemImageIndex >= 0
|
||||
&& itemImageIndex < tutorialItemImages.Length
|
||||
&& tutorialItemImages[itemImageIndex] != null
|
||||
&& tutorialItemImages[itemImageIndex].sprite != null;
|
||||
}
|
||||
|
||||
private int GetTutorialItemImageIndex() {
|
||||
if(tutorialGuideType != TutorialGuideType.Items)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
string itemText = (tutorialTitle + " " + tutorialMessage).Trim();
|
||||
if(itemText.Contains("초밥"))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(itemText.Contains("라멘"))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(itemText.Contains("방어막"))
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
if(itemText.Contains("운동화"))
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
if(itemText.Contains("마일리지"))
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
private Color GetActiveLifeIconColor(Image lifeIcon) {
|
||||
if(lifeIcon != null && lifeIcon.sprite == null)
|
||||
{
|
||||
@@ -1061,8 +1131,8 @@ public class GameManager : MonoBehaviour {
|
||||
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(11f + (i * 27f), 0f);
|
||||
itemRect.sizeDelta = new Vector2(24f, 24f);
|
||||
itemRect.anchoredPosition = new Vector2(14f, 0f);
|
||||
itemRect.sizeDelta = new Vector2(54f, 54f);
|
||||
|
||||
Image itemImage = itemObject.GetComponent<Image>();
|
||||
itemImage.sprite = LoadTutorialSprite(itemAssetPaths[i]);
|
||||
|
||||
Reference in New Issue
Block a user