-
-
Save todorok1/327a04a2df09e80e69217e98efa3b2f3 to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第118回 お店画面のアイテムウィンドウを制御するクラス
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; | |
| } | |
| if (_shopManager.SelectedCommand == ShopCommand.Buy) | |
| { | |
| var itemData = _buyController.GetItemData(_selectedIndex); | |
| if (itemData == null) | |
| { | |
| return; | |
| } | |
| _shopManager.OnSelectedItem(itemData); | |
| // 選択時の効果音を再生します。 | |
| AudioManager.Instance.PlaySe(SeNames.OK); | |
| } | |
| else if (_shopManager.SelectedCommand == ShopCommand.Sell) | |
| { | |
| var itemData = _sellController.GetItemData(_selectedIndex); | |
| if (itemData == null) | |
| { | |
| return; | |
| } | |
| _shopManager.OnSelectedItem(itemData); | |
| // 選択時の効果音を再生します。 | |
| AudioManager.Instance.PlaySe(SeNames.OK); | |
| } | |
| SetCanSelectState(false); | |
| } | |
| /// <summary> | |
| /// キャンセルボタンが押された時の処理です。 | |
| /// </summary> | |
| void OnPressedCancelButton() | |
| { | |
| // キャンセル時の効果音を再生します。 | |
| AudioManager.Instance.PlaySe(SeNames.Cancel); | |
| StartCoroutine(HideProcess()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment