Files
Ipseity-Demo/Packages/OctoCore/Runtime/Scripts/Navigation/OctoSceneTrigger.cs
T
2026-02-09 23:53:14 +01:00

38 lines
1.0 KiB
C#

using UnityEngine;
using OctoCore.Navigation.Data;
namespace OctoCore.Navigation
{
/// <summary>
/// Scene trigger component.
/// Links OctoWorldEvent to the scene loading system.
/// Call LoadScene() from OctoWorldEvent to load a scene.
/// </summary>
public class OctoSceneTrigger : MonoBehaviour
{
[SerializeField, Tooltip("Scene data to load")]
private OctoSceneData _sceneData;
/// <summary>
/// Load the configured scene.
/// This method should be called from OctoWorldEvent.
/// </summary>
public void LoadScene()
{
if (!OctoCore.Instance)
{
Debug.LogError("[OctoSceneTrigger] OctoCore instance not found");
return;
}
if (_sceneData == null)
{
Debug.LogError("[OctoSceneTrigger] SceneData is null");
return;
}
OctoCore.Instance.Navigation.LoadScene(_sceneData);
}
}
}