OctoCore 0.0.1
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user