Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created April 30, 2025 11:10
Show Gist options
  • Save todorok1/f102e37a6f27da5c59be434b148b5043 to your computer and use it in GitHub Desktop.
Save todorok1/f102e37a6f27da5c59be434b148b5043 to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第72回 メニュー画面全体を管理するクラス
/// <summary>
/// 選択されたメニューに応じた処理を呼び出します。
/// </summary>
void HandleMenu()
{
switch (SelectedMenu)
{
case MenuCommand.Item:
case MenuCommand.Magic:
ShowItemMenu();
break;
case MenuCommand.Equipment:
ShowEquipmentMenu();
break;
case MenuCommand.Status:
// ステータスメニューを開く処理
break;
case MenuCommand.Save:
// セーブメニューを開く処理
break;
case MenuCommand.QuitGame:
// ゲーム終了処理
break;
case MenuCommand.Close:
_topMenuWindowController.CloseMenu();
break;
}
}
/// <summary>
/// アイテムメニューを表示します。
/// </summary>
void ShowItemMenu()
{
MenuPhase = MenuPhase.Item;
_menuItemWindowController.SetUpController(this);
_menuItemWindowController.SetUpWindow();
_menuItemWindowController.SetPageElement();
_menuItemWindowController.ShowWindow();
_menuItemWindowController.SetCanSelectState(true);
}
/// <summary>
/// 装備メニューを表示します。
/// </summary>
void ShowEquipmentMenu()
{
MenuPhase = MenuPhase.Equipment;
_menuEquipmentWindowController.SetUpController(this);
_menuEquipmentWindowController.ShowWindow();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment