Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created April 27, 2025 07:29
Show Gist options
  • Save todorok1/d6fd8ee686d82dbf9816a3ae95bbdf0c to your computer and use it in GitHub Desktop.
Save todorok1/d6fd8ee686d82dbf9816a3ae95bbdf0c to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第70回 メニュー画面のアイテムウィンドウを制御するクラス
/// <summary>
/// 回復アイテムのメッセージを表示します。
/// </summary>
IEnumerator ShowItemHealMessage(int characterId, string itemName, int healValue)
{
var characterName = CharacterDataManager.GetCharacterName(characterId);
string actorName = characterName;
string targetName = characterName;
_mapMessageWindowController.SetUpController(_windowController);
_mapMessageWindowController.HidePager();
_mapMessageWindowController.ShowWindow();
_windowController.SetCanSelectState(false);
_windowController.SetPauseMessageState(true);
_mapMessageWindowController.GenerateUseItemMessage(actorName, itemName);
while (_windowController.IsPausedMessage)
{
yield return null;
}
_windowController.SetPauseMessageState(true);
_mapMessageWindowController.GenerateHpHealMessage(targetName, healValue);
_windowController.UpdateStatus();
while (_windowController.IsPausedMessage)
{
yield return null;
}
// キー入力を待ちます。
_mapMessageWindowController.StartKeyWait();
while (_mapMessageWindowController.IsWaitingKeyInput)
{
yield return null;
}
_mapMessageWindowController.HideWindow();
_itemController.OnFinishedItemProcess();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment