Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created August 13, 2025 09:34
Show Gist options
  • Select an option

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

Select an option

Save todorok1/cca239b9619d0ace70422bd5c961907e to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第116回 コマンドウィンドウを制御するクラス
/// <summary>
/// コマンドを選択します。
/// </summary>
void SelectCommand()
{
if (_battleManager == null)
{
return;
}
if (_battleManager.BattlePhase != BattlePhase.InputCommand)
{
return;
}
if (!_canSelect)
{
return;
}
if (Input.GetKeyUp(KeyCode.UpArrow))
{
SetPreCommand();
uiController.ShowSelectedCursor(_selectedCommand);
}
else if (Input.GetKeyUp(KeyCode.DownArrow))
{
SetNextCommand();
uiController.ShowSelectedCursor(_selectedCommand);
}
else if (InputGameKey.ConfirmButton())
{
// 選択時の効果音を再生します。
AudioManager.Instance.PlaySe(SeNames.OK);
_battleManager.OnCommandSelected(_selectedCommand);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment