-
-
Save todorok1/3aab7aad8bb2b37381fd724a635542f1 to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第116回 選択ウィンドウを制御するクラス
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// 項目が選択された時の処理です。 | |
| /// </summary> | |
| void OnPressedConfirmButton() | |
| { | |
| if (!IsValidSelection()) | |
| { | |
| return; | |
| } | |
| // 選択時の効果音を再生します。 | |
| AudioManager.Instance.PlaySe(SeNames.OK); | |
| if (_battleManager.SelectedCommand == BattleCommand.Magic) | |
| { | |
| var magicData = _magicController.GetMagicData(_selectedIndex); | |
| if (magicData != null) | |
| { | |
| _battleManager.OnItemSelected(magicData.magicId); | |
| HideWindow(); | |
| SetCanSelectState(false); | |
| } | |
| } | |
| else if (_battleManager.SelectedCommand == BattleCommand.Item) | |
| { | |
| var itemInfo = _itemController.GetItemInfo(_selectedIndex); | |
| if (itemInfo != null) | |
| { | |
| _battleManager.OnItemSelected(itemInfo.itemId); | |
| HideWindow(); | |
| SetCanSelectState(false); | |
| } | |
| } | |
| } | |
| /// <summary> | |
| /// キャンセルボタンが押された時の処理です。 | |
| /// </summary> | |
| void OnPressedCancelButton() | |
| { | |
| // キャンセル時の効果音を再生します。 | |
| AudioManager.Instance.PlaySe(SeNames.Cancel); | |
| _battleManager.OnItemCanceled(); | |
| HideWindow(); | |
| SetCanSelectState(false); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment