Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created July 9, 2025 04:42
Show Gist options
  • Select an option

  • Save todorok1/085fb2ce247f1afdff97bb37d8a4c860 to your computer and use it in GitHub Desktop.

Select an option

Save todorok1/085fb2ce247f1afdff97bb37d8a4c860 to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第102回 マップ機能を管理するクラス
/// <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