Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created August 14, 2025 03:22
Show Gist options
  • Select an option

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

Select an option

Save todorok1/81bd58df14fa205403e5d5671044bb0f to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第118回 お店の選択肢ウィンドウの動作を制御するクラス
/// <summary>
/// 決定ボタンが押された時の処理です。
/// </summary>
protected override void OnPressedConfirmButton()
{
if (_callback != null)
{
_callback.OnSelectedShopOption(_selectedIndex);
}
StartCoroutine(HideProcess());
// 選択時の効果音を再生します。
AudioManager.Instance.PlaySe(SeNames.OK);
}
/// <summary>
/// キャンセルボタンが押された時の処理です。
/// </summary>
protected override void OnPressedCancelButton()
{
// キャンセルされた場合は、区別できるように-1を渡します。
int canceledIndex = -1;
if (_callback != null)
{
_callback.OnSelectedShopOption(canceledIndex);
}
StartCoroutine(HideProcess());
// キャンセル時の効果音を再生します。
AudioManager.Instance.PlaySe(SeNames.Cancel);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment