피싱룸
This commit is contained in:
@@ -49,6 +49,20 @@ public class FishingGaugeUI : MonoBehaviour
|
||||
[Tooltip("SuccessZone. Image Type = Filled, Fill Method = Radial 360")]
|
||||
[SerializeField] private Image successZone;
|
||||
|
||||
[Header("Simple Reel UI")]
|
||||
[Tooltip("릴 감기 진행도 게이지 루트입니다. 없으면 텍스트만 업데이트됩니다.")]
|
||||
[SerializeField] private GameObject reelProgressGaugeRoot;
|
||||
|
||||
[Tooltip("릴 감기 진행도 Fill Image입니다. Image Type = Filled / Horizontal / Left 추천.")]
|
||||
[SerializeField] private Image reelProgressGaugeFill;
|
||||
|
||||
[Tooltip("현재 줄 길이를 보여줄 텍스트입니다. CounterPanel 안에 LineLengthText를 추가해서 연결하세요.")]
|
||||
[SerializeField] private TMP_Text lineLengthText;
|
||||
|
||||
[SerializeField] private string simpleReelObjectiveText = "릴을 감아 끌어올려라";
|
||||
[SerializeField] private string simpleReelIdleText = "릴 손잡이를 잡고 돌려라";
|
||||
[SerializeField] private string simpleReelReelingText = "좋다, 계속 감아라!";
|
||||
|
||||
[Header("Round Result UI")]
|
||||
[SerializeField] private TMP_Text resultText;
|
||||
|
||||
@@ -134,6 +148,9 @@ public class FishingGaugeUI : MonoBehaviour
|
||||
[Tooltip("게임 클리어/실패 최종 결과가 뜰 때 진행 UI를 전부 숨기고 FinalResultPanel만 보이게 합니다.")]
|
||||
[SerializeField] private bool showOnlyFinalResult = true;
|
||||
|
||||
[Tooltip("FinalResultPanel을 숨길 때 진행 UI를 다시 켤지 결정합니다. 클리어 후 UI를 완전히 닫는 구조면 Off로 두세요.")]
|
||||
[SerializeField] private bool restoreGameplayUIAfterFinalResult = true;
|
||||
|
||||
[Tooltip("BackgroundPanel. 최종 결과창만 보이고 싶으면 자동 연결하거나 직접 연결하세요.")]
|
||||
[SerializeField] private GameObject gameplayBackgroundRoot;
|
||||
|
||||
@@ -267,6 +284,9 @@ public void AutoBindMissingReferences()
|
||||
if (gaugeGroupRect == null) gaugeGroupRect = FindComponentByName<RectTransform>("GaugeGroup");
|
||||
if (pointerPivot == null) pointerPivot = FindComponentByName<RectTransform>("PointerPivot");
|
||||
if (successZone == null) successZone = FindComponentByName<Image>("SuccessZone");
|
||||
if (reelProgressGaugeRoot == null) reelProgressGaugeRoot = FindGameObject("ReelProgressGauge", "ReelProgressGroup", "ReelFightProgressGauge");
|
||||
if (reelProgressGaugeFill == null) reelProgressGaugeFill = FindComponentByName<Image>("ReelProgressGaugeFill", "ReelProgressFill", "ReelFightProgressFill");
|
||||
if (lineLengthText == null) lineLengthText = FindComponentByName<TMP_Text>("LineLengthText", "Line Length Text", "LineText");
|
||||
if (resultText == null) resultText = FindComponentByName<TMP_Text>("ResultText");
|
||||
|
||||
if (itemIcon == null) itemIcon = FindComponentByName<Image>("ItemIcon");
|
||||
@@ -327,6 +347,7 @@ public void InitializeFishingUI()
|
||||
UpdateInventoryUI(0, 0, 0, 0);
|
||||
lastCleanupFill = -1f;
|
||||
SetCleanupFill(0f, true);
|
||||
SetSimpleReelUIVisible(false);
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
@@ -390,6 +411,55 @@ public void UpdateCounter(int success, int successTarget, int fail, int failTarg
|
||||
failText.text = $"실패 {fail}/{failTarget}";
|
||||
}
|
||||
|
||||
public void SetTimingGaugeVisible(bool visible)
|
||||
{
|
||||
if (gaugeGroupRoot != null)
|
||||
gaugeGroupRoot.SetActive(visible);
|
||||
else if (gaugeGroupRect != null)
|
||||
gaugeGroupRect.gameObject.SetActive(visible);
|
||||
}
|
||||
|
||||
public void SetSimpleReelUIVisible(bool visible)
|
||||
{
|
||||
if (reelProgressGaugeRoot != null)
|
||||
reelProgressGaugeRoot.SetActive(visible);
|
||||
}
|
||||
|
||||
public void UpdateSimpleReelUI(float progress, float lineLength, bool isReeling)
|
||||
{
|
||||
ShowCounter();
|
||||
|
||||
progress = Mathf.Clamp01(progress);
|
||||
lineLength = Mathf.Max(0f, lineLength);
|
||||
int progressPercent = Mathf.RoundToInt(progress * 100f);
|
||||
|
||||
if (catchCountText != null)
|
||||
catchCountText.text = $"끌어올리기 {progressPercent}%";
|
||||
|
||||
if (successText != null && successText != catchCountText)
|
||||
successText.text = $"끌어올리기 {progressPercent}%";
|
||||
|
||||
if (failText != null)
|
||||
failText.text = $"줄 길이 {lineLength:0.0}m";
|
||||
|
||||
if (lineLengthText != null)
|
||||
lineLengthText.text = $"줄 길이 {lineLength:0.0}m";
|
||||
|
||||
if (reelProgressGaugeFill != null)
|
||||
reelProgressGaugeFill.fillAmount = progress;
|
||||
|
||||
if (objectiveText != null && !string.IsNullOrWhiteSpace(simpleReelObjectiveText))
|
||||
objectiveText.text = simpleReelObjectiveText;
|
||||
|
||||
if (resultText != null && resultText.gameObject.activeSelf)
|
||||
{
|
||||
if (isReeling && progress < 1f)
|
||||
resultText.text = simpleReelReelingText;
|
||||
else if (progress < 1f && !string.IsNullOrWhiteSpace(simpleReelIdleText))
|
||||
resultText.text = simpleReelIdleText;
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateFishingProgress(int cleanupItemCount, int cleanupTarget, bool pondCleaned, bool memoryPieceCollected, int totalCaughtItems)
|
||||
{
|
||||
cleanupTarget = Mathf.Max(1, cleanupTarget);
|
||||
@@ -622,6 +692,30 @@ public void ShowResult(string text, Color color)
|
||||
resultRoutine = StartCoroutine(ResultRoutine(text, color));
|
||||
}
|
||||
|
||||
public void ShowPersistentResult(string text)
|
||||
{
|
||||
ShowPersistentResult(text, defaultResultColor);
|
||||
}
|
||||
|
||||
public void ShowPersistentResult(string text, Color color)
|
||||
{
|
||||
if (resultText == null)
|
||||
return;
|
||||
|
||||
if (resultRoutine != null)
|
||||
{
|
||||
StopCoroutine(resultRoutine);
|
||||
resultRoutine = null;
|
||||
}
|
||||
|
||||
resultText.gameObject.SetActive(true);
|
||||
resultText.color = color;
|
||||
resultText.text = text;
|
||||
|
||||
if (effects != null)
|
||||
effects.Pop(resultText.transform, resultPopScale, resultPopTime);
|
||||
}
|
||||
|
||||
public void ShowResultForType(FishingGameManager.ResultType resultType)
|
||||
{
|
||||
switch (resultType)
|
||||
@@ -922,7 +1016,11 @@ private void HideNotice(bool instant)
|
||||
memoryPieceNoticePanel.SetActive(false);
|
||||
|
||||
if (memoryPieceNoticeCanvasGroup != null)
|
||||
{
|
||||
memoryPieceNoticeCanvasGroup.alpha = 0f;
|
||||
memoryPieceNoticeCanvasGroup.interactable = false;
|
||||
memoryPieceNoticeCanvasGroup.blocksRaycasts = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -946,14 +1044,20 @@ public void SetControllerGuideVisible(bool visible)
|
||||
private void SetControllerGuideVisible(bool visible, bool instant)
|
||||
{
|
||||
if (effects != null && !instant)
|
||||
{
|
||||
effects.FadeCanvasGroup(controllerGuidePanel, controllerGuideCanvasGroup, visible, panelFadeTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (controllerGuidePanel != null)
|
||||
controllerGuidePanel.SetActive(visible);
|
||||
|
||||
if (controllerGuideCanvasGroup != null)
|
||||
{
|
||||
controllerGuideCanvasGroup.alpha = visible ? 1f : 0f;
|
||||
controllerGuideCanvasGroup.interactable = visible;
|
||||
controllerGuideCanvasGroup.blocksRaycasts = visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1034,6 +1138,9 @@ private void SetGameplayUIVisible(bool visible)
|
||||
SetGameObjectVisible(itemSlotPanel, visible);
|
||||
SetGameObjectVisible(cleanupGaugeRoot, visible);
|
||||
|
||||
if (!visible)
|
||||
SetSimpleReelUIVisible(false);
|
||||
|
||||
if (gaugeGroupRoot != null)
|
||||
gaugeGroupRoot.SetActive(visible);
|
||||
else if (gaugeGroupRect != null)
|
||||
@@ -1142,9 +1249,14 @@ private void HideFinalResult(bool showCounterAfterHide, bool instant)
|
||||
if (showCounterAfterHide)
|
||||
{
|
||||
if (showOnlyFinalResult)
|
||||
SetGameplayUIVisible(true);
|
||||
{
|
||||
if (restoreGameplayUIAfterFinalResult)
|
||||
SetGameplayUIVisible(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowCounter();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user