Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created August 22, 2025 12:00
Show Gist options
  • Select an option

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

Select an option

Save todorok1/6a2bebad627ccdc7a1d184be39c68763 to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第123回 タイトル画面のつづきからのメニューを制御するクラス
/// <summary>
/// 選択されたセーブ枠がロード可能かどうかを確認します。
/// </summary>
bool CanLoadSlot()
{
var saveSlot = _saveDataManager.GetSaveSlot(_selectedSlot);
if (saveSlot == null)
{
return false;
}
var statusInfo = saveSlot.saveInfoStatus;
if (statusInfo == null)
{
return false;
}
return true;
}
/// <summary>
/// 決定ボタンが押された時の処理です。
/// </summary>
void OnPressedConfirmButton()
{
// セーブ枠がロードできない場合は処理を抜けます。
if (!CanLoadSlot())
{
return;
}
// 選択時の効果音を再生します。
AudioManager.Instance.PlaySe(SeNames.OK);
_canSelect = false;
_titleMenuManager.OnSelectedSlotId(_selectedSlot);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment