Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created August 26, 2025 08:23
Show Gist options
  • Select an option

  • Save todorok1/67d6a244763f66ef20ca35ced8dea64c to your computer and use it in GitHub Desktop.

Select an option

Save todorok1/67d6a244763f66ef20ca35ced8dea64c to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第126回 メニューウィンドウでアイテムの使用処理を制御するクラス
/// <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;
}
// 回復の効果音を再生します。
AudioManager.Instance.PlaySe(SeNames.Heal);
_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