using System.Collections.Generic; using Cielonos.Core.Interaction; using Sirenix.OdinInspector; using UnityEngine; using UnityEngine.SceneManagement; namespace Cielonos.MainGame.Interactions { public partial class SceneTeleportationSite : InteractableObjectBase { [ValueDropdown("GetAllSceneNames")] public string targetSceneName; protected override void InitializeChoices() { choices.Add(new InteractionChoice("Teleport", Teleport)); } private void Teleport() { if (targetSceneName != "") { Debug.Log($"[SceneTeleportationSite] Teleporting to scene: {targetSceneName}"); SceneManager.LoadScene(targetSceneName); } } } public partial class SceneTeleportationSite { private List GetAllSceneNames() { List sceneNames = new List(); int sceneCount = SceneManager.sceneCountInBuildSettings; for (int i = 0; i < sceneCount; i++) { string path = SceneUtility.GetScenePathByBuildIndex(i); string name = System.IO.Path.GetFileNameWithoutExtension(path); sceneNames.Add(name); } return sceneNames; } } }