-
-
Save todorok1/085fb2ce247f1afdff97bb37d8a4c860 to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第102回 マップ機能を管理するクラス
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> | |
| public void CheckEvent() | |
| { | |
| StartCoroutine(CheckEventProcess()); | |
| } | |
| /// <summary> | |
| /// マップ内のイベントを確認します。 | |
| /// </summary> | |
| IEnumerator CheckEventProcess() | |
| { | |
| _characterMoverManager.StopCharacterMover(); | |
| yield return null; | |
| var eventFiles = GetEventsInMap(); | |
| yield return StartCoroutine(CheckEventGraphic(eventFiles)); | |
| yield return StartCoroutine(CheckAutoEventProcess(eventFiles)); | |
| } | |
| /// <summary> | |
| /// マップ内のイベントのグラフィックを確認します。 | |
| /// </summary> | |
| public IEnumerator CheckEventGraphic(EventFileData[] eventFiles) | |
| { | |
| yield return null; | |
| foreach (var eventData in eventFiles) | |
| { | |
| eventData.SetEventGraphic(); | |
| } | |
| } | |
| /// <summary> | |
| /// マップ内の自動イベントを確認します。 | |
| /// </summary> | |
| public IEnumerator CheckAutoEventProcess(EventFileData[] eventFiles) | |
| { | |
| yield return null; | |
| if (_currentMapController == null) | |
| { | |
| SimpleLogger.Instance.Log("現在のマップコントローラーが設定されていません。"); | |
| yield break; | |
| } | |
| foreach (var eventData in eventFiles) | |
| { | |
| // 自動イベントを実行します。 | |
| var eventQueue = new EventQueue | |
| { | |
| targetObj = eventData.gameObject, | |
| rpgEventTrigger = RpgEventTrigger.Auto, | |
| callback = null | |
| }; | |
| _eventProcessor.AddQueue(eventQueue); | |
| } | |
| _eventProcessor.StartEvent(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment