-
-
Save todorok1/5acae8c4ff0b2a37eb9d653d47122c1b to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第103回 戦闘の結果処理を管理するクラス
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) | |
| { | |
| // パーティの最初のメンバーの名前を取得します。 | |
| 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; | |
| } | |
| foreach (var id in CharacterStatusManager.partyCharacter) | |
| { | |
| var isLevelUp = CharacterStatusManager.CheckLevelUp(id); | |
| if (isLevelUp) | |
| { | |
| _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; | |
| } | |
| } | |
| } | |
| // 処理の終了を通知します。 | |
| _battleManager.OnFinishBattle(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment