-
-
Save todorok1/6c3d406fcb5c1e34955c5707f54ba6c2 to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第88回 イベントのまとまりを制御するクラス
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
| using System.Collections.Generic; | |
| using UnityEngine; | |
| namespace SimpleRpg | |
| { | |
| /// <summary> | |
| /// イベントのまとまりを制御するクラスです。 | |
| /// </summary> | |
| public class EventFileData : MonoBehaviour | |
| { | |
| /// <summary> | |
| /// 条件に応じたイベントの画像を制御するクラスへの参照です。 | |
| /// </summary> | |
| [SerializeField] | |
| EventGraphicController _eventGraphicController; | |
| /// <summary> | |
| /// イベントページのリストです。 | |
| /// </summary> | |
| List<EventPage> _eventPages; | |
| /// <summary> | |
| /// イベントの処理を行うクラスへの参照です。 | |
| /// </summary> | |
| EventProcessor _eventProcessor; | |
| /// <summary> | |
| /// イベントを処理するクラスへの参照をセットします。 | |
| /// </summary> | |
| public void SetReference(EventProcessor eventProcessor) | |
| { | |
| _eventProcessor = eventProcessor; | |
| } | |
| /// <summary> | |
| /// 対象のイベントページの処理を開始します。 | |
| /// </summary> | |
| public void ExecuteEvent(RpgEventTrigger rpgEventTrigger) | |
| { | |
| SetUpEventPages(); | |
| var targetPage = GetEventPage(rpgEventTrigger); | |
| if (targetPage == null) | |
| { | |
| SimpleLogger.Instance.Log($"実行可能なイベントページが見つかりませんでした。イベントのトリガー : {rpgEventTrigger}"); | |
| _eventProcessor.OnEventFinished(); | |
| return; | |
| } | |
| targetPage.StartEvent(_eventProcessor, this); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment