-
-
Save todorok1/8ab893ea2a7a84bd141d6112fd834b93 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> | |
| /// <param name="exp">獲得経験値</param> | |
| /// <param name="gold">獲得ゴールド</param> | |
| IEnumerator WinMessageProcess(int exp, int gold) | |
| { | |
| // 戦闘BGMを停止します。 | |
| float fadeTime = 0.1f; | |
| AudioManager.Instance.StopAllBgm(fadeTime); | |
| // 戦闘勝利のジングルを再生します。 | |
| AudioManager.Instance.PlaySe(SeNames.BattleWin); | |
| // パーティの最初のメンバーの名前を取得します。 | |
| var firstMemberId = CharacterStatusManager.partyCharacter[0]; | |
| var characterName = CharacterDataManager.GetCharacterName(firstMemberId); | |
| _pauseMessage = true; | |
| _messageWindowController.GenerateWinMessage(characterName); | |
| while (_pauseMessage) | |
| { | |
| yield return null; | |
| } | |
| if (exp > 0) | |
| { | |
| _pauseMessage = true; | |
| _messageWindowController.GenerateGetExpMessage(exp); | |
| while (_pauseMessage) | |
| { | |
| yield return null; | |
| } | |
| } | |
| if (gold > 0) | |
| { | |
| _pauseMessage = true; | |
| _messageWindowController.GenerateGetGoldMessage(gold); | |
| while (_pauseMessage) | |
| { | |
| yield return null; | |
| } | |
| } | |
| // キー入力を待ちます。 | |
| _messageWindowController.StartKeyWait(); | |
| while (_messageWindowController.IsWaitingKeyInput) | |
| { | |
| yield return null; | |
| } | |
| // 選択時の効果音を再生します。 | |
| AudioManager.Instance.PlaySe(SeNames.OK); | |
| foreach (var id in CharacterStatusManager.partyCharacter) | |
| { | |
| var isLevelUp = CharacterStatusManager.CheckLevelUp(id); | |
| if (isLevelUp) | |
| { | |
| // レベルアップ時のジングルを再生します。 | |
| AudioManager.Instance.PlaySe(SeNames.LevelUp); | |
| _pauseMessage = true; | |
| var characterStatus = CharacterStatusManager.GetCharacterStatusById(id); | |
| var level = characterStatus.level; | |
| CharacterStatusManager.LearnMagic(id); | |
| characterName = CharacterDataManager.GetCharacterName(id); | |
| _messageWindowController.GenerateLevelUpMessage(characterName, level); | |
| while (_pauseMessage) | |
| { | |
| yield return null; | |
| } | |
| // キー入力を待ちます。 | |
| _messageWindowController.StartKeyWait(); | |
| while (_messageWindowController.IsWaitingKeyInput) | |
| { | |
| yield return null; | |
| } | |
| // 選択時のジングルを再生します。 | |
| AudioManager.Instance.PlaySe(SeNames.OK); | |
| } | |
| } | |
| // 処理の終了を通知します。 | |
| _battleManager.OnFinishBattle(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment