2026.06.29 17:43
This commit is contained in:
@@ -156,6 +156,69 @@ public class FishingGaugeUI : MonoBehaviour
|
||||
[Header("Item Icons")]
|
||||
[SerializeField] private FishingItemIconData[] itemIcons;
|
||||
|
||||
[Header("Caught Item Random Texts")]
|
||||
[Tooltip("물고기를 낚았을 때 랜덤으로 표시할 제목 문구입니다.")]
|
||||
[SerializeField] private string[] fishCaughtMessages =
|
||||
{
|
||||
"물고기를 낚았다!",
|
||||
"작은 물고기가 걸렸다!",
|
||||
"연못에서 물고기가 올라왔다.",
|
||||
"평범한 물고기를 낚았다.",
|
||||
"힘차게 팔딱이는 물고기다!",
|
||||
"낚싯줄 끝에서 물고기가 반짝였다."
|
||||
};
|
||||
|
||||
[Tooltip("쓰레기를 낚았을 때 랜덤으로 표시할 제목 문구입니다.")]
|
||||
[SerializeField] private string[] trashCaughtMessages =
|
||||
{
|
||||
"쓰레기를 건져냈다!",
|
||||
"낡은 쓰레기가 걸렸다.",
|
||||
"연못 속 오염물을 꺼냈다.",
|
||||
"물고기는 아니지만, 연못은 조금 깨끗해졌다.",
|
||||
"버려진 쓰레기를 낚아 올렸다.",
|
||||
"찌 아래에 숨어 있던 쓰레기를 끌어냈다."
|
||||
};
|
||||
|
||||
[Tooltip("기억의 조각을 낚았을 때 랜덤으로 표시할 제목 문구입니다.")]
|
||||
[SerializeField] private string[] memoryPieceCaughtMessages =
|
||||
{
|
||||
"기억의 조각을 되찾았다!",
|
||||
"빛나는 기억의 조각이 떠올랐다.",
|
||||
"잊고 있던 기억이 손에 닿았다.",
|
||||
"연못 속에서 기억의 조각을 발견했다.",
|
||||
"희미한 빛이 기억의 조각으로 모였다."
|
||||
};
|
||||
|
||||
[Tooltip("물고기를 낚았을 때 랜덤으로 표시할 설명 문구입니다.")]
|
||||
[SerializeField] private string[] fishHintMessages =
|
||||
{
|
||||
"평범한 물고기다.",
|
||||
"연못에 아직 생명이 남아 있다.",
|
||||
"작지만 건강해 보인다.",
|
||||
"특별하진 않지만 나쁘지 않은 수확이다.",
|
||||
"조용한 연못에서 살아남은 물고기다."
|
||||
};
|
||||
|
||||
[Tooltip("쓰레기를 낚았을 때 랜덤으로 표시할 설명 문구입니다.")]
|
||||
[SerializeField] private string[] trashHintMessages =
|
||||
{
|
||||
"연못이 조금 맑아졌다.",
|
||||
"이런 것들이 연못을 더럽히고 있었다.",
|
||||
"하나씩 치우면 물이 맑아질 것이다.",
|
||||
"기억의 조각에 한 걸음 가까워졌다.",
|
||||
"연못 아래의 탁한 기운이 조금 걷혔다."
|
||||
};
|
||||
|
||||
[Tooltip("기억의 조각을 낚았을 때 랜덤으로 표시할 설명 문구입니다.")]
|
||||
[SerializeField] private string[] memoryPieceHintMessages =
|
||||
{
|
||||
"잃어버린 기억의 일부다.",
|
||||
"연못이 맑아지자 모습을 드러냈다.",
|
||||
"오래전의 기억이 희미하게 느껴진다.",
|
||||
"이 조각이 무언가를 떠올리게 한다.",
|
||||
"빛이 손끝에서 조용히 흔들린다."
|
||||
};
|
||||
|
||||
[Header("Guide UI")]
|
||||
[SerializeField] private bool showControllerGuideOnInitialize = true;
|
||||
|
||||
@@ -684,7 +747,9 @@ public void ShowCaughtItem(string text)
|
||||
public void ShowCaughtItem(FishingItemType itemType, string displayName, bool countsAsCleanupItem, string extraMessage = null)
|
||||
{
|
||||
string caughtMessage = GetCaughtMessage(itemType, displayName);
|
||||
string hintMessage = string.IsNullOrWhiteSpace(extraMessage) ? GetDefaultHint(itemType, countsAsCleanupItem) : extraMessage;
|
||||
string defaultHint = GetDefaultHint(itemType, countsAsCleanupItem);
|
||||
string hintMessage = CombineHintMessage(defaultHint, extraMessage);
|
||||
|
||||
ShowCaughtItem(itemType, caughtMessage, hintMessage);
|
||||
}
|
||||
|
||||
@@ -824,36 +889,97 @@ private FishingItemIconData GetIconData(FishingItemType itemType)
|
||||
|
||||
private string GetCaughtMessage(FishingItemType itemType, string displayName)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(displayName) && itemType != FishingItemType.None)
|
||||
return $"{displayName}을(를) 낚았다!";
|
||||
|
||||
switch (itemType)
|
||||
{
|
||||
case FishingItemType.Fish: return "물고기를 낚았다!";
|
||||
case FishingItemType.Trash: return "쓰레기를 건져냈다!";
|
||||
case FishingItemType.MemoryPiece: return "기억의 조각을 찾았다!";
|
||||
default: return string.IsNullOrWhiteSpace(displayName) ? "무언가를 낚았다!" : displayName;
|
||||
case FishingItemType.Fish:
|
||||
return PickRandomText(fishCaughtMessages, "물고기를 낚았다!");
|
||||
|
||||
case FishingItemType.Trash:
|
||||
return PickRandomText(trashCaughtMessages, "쓰레기를 건져냈다!");
|
||||
|
||||
case FishingItemType.MemoryPiece:
|
||||
return PickRandomText(memoryPieceCaughtMessages, "기억의 조각을 되찾았다!");
|
||||
|
||||
case FishingItemType.None:
|
||||
default:
|
||||
return string.IsNullOrWhiteSpace(displayName) ? "무언가를 낚았다!" : displayName;
|
||||
}
|
||||
}
|
||||
|
||||
private string GetDefaultHint(FishingItemType itemType, bool countsAsCleanupItem)
|
||||
{
|
||||
FishingItemIconData iconData = GetIconData(itemType);
|
||||
|
||||
if (iconData != null && !string.IsNullOrWhiteSpace(iconData.hintText))
|
||||
return iconData.hintText;
|
||||
|
||||
if (countsAsCleanupItem)
|
||||
return "연못이 조금 맑아졌다.";
|
||||
string iconHint = iconData != null ? iconData.hintText : null;
|
||||
|
||||
switch (itemType)
|
||||
{
|
||||
case FishingItemType.Fish: return "평범한 물고기다.";
|
||||
case FishingItemType.MemoryPiece: return "잃어버린 기억의 일부다.";
|
||||
default: return string.Empty;
|
||||
case FishingItemType.Fish:
|
||||
return PickRandomText(fishHintMessages, string.IsNullOrWhiteSpace(iconHint) ? "평범한 물고기다." : iconHint);
|
||||
|
||||
case FishingItemType.Trash:
|
||||
return PickRandomText(trashHintMessages, string.IsNullOrWhiteSpace(iconHint) ? "연못이 조금 맑아졌다." : iconHint);
|
||||
|
||||
case FishingItemType.MemoryPiece:
|
||||
return PickRandomText(memoryPieceHintMessages, string.IsNullOrWhiteSpace(iconHint) ? "잃어버린 기억의 일부다." : iconHint);
|
||||
|
||||
default:
|
||||
if (!string.IsNullOrWhiteSpace(iconHint))
|
||||
return iconHint;
|
||||
|
||||
return countsAsCleanupItem ? "연못이 조금 맑아졌다." : string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
private string CombineHintMessage(string defaultHint, string extraMessage)
|
||||
{
|
||||
bool hasDefault = !string.IsNullOrWhiteSpace(defaultHint);
|
||||
bool hasExtra = !string.IsNullOrWhiteSpace(extraMessage);
|
||||
|
||||
if (hasDefault && hasExtra)
|
||||
return $"{defaultHint}\n{extraMessage}";
|
||||
|
||||
if (hasDefault)
|
||||
return defaultHint;
|
||||
|
||||
if (hasExtra)
|
||||
return extraMessage;
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
private string PickRandomText(string[] messages, string fallback)
|
||||
{
|
||||
if (messages == null || messages.Length == 0)
|
||||
return fallback;
|
||||
|
||||
int validCount = 0;
|
||||
|
||||
for (int i = 0; i < messages.Length; i++)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(messages[i]))
|
||||
validCount++;
|
||||
}
|
||||
|
||||
if (validCount == 0)
|
||||
return fallback;
|
||||
|
||||
int targetIndex = UnityEngine.Random.Range(0, validCount);
|
||||
int currentIndex = 0;
|
||||
|
||||
for (int i = 0; i < messages.Length; i++)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(messages[i]))
|
||||
continue;
|
||||
|
||||
if (currentIndex == targetIndex)
|
||||
return messages[i];
|
||||
|
||||
currentIndex++;
|
||||
}
|
||||
|
||||
return fallback;
|
||||
}
|
||||
|
||||
public void ShowNotice(string message)
|
||||
{
|
||||
if (noticeRoutine != null)
|
||||
|
||||
Reference in New Issue
Block a user