VirtualFramework/Assets/Scripts/Editor/OpeanCustomScene.cs

20 lines
546 B
C#
Raw Normal View History

using UnityEngine;
using UnityEngine.SceneManagement;
2025-02-18 17:23:30 +08:00
#if UNITY_EDITOR
public class OpeanCustomScene : MonoBehaviour
{
2025-02-18 17:23:30 +08:00
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
private static void Initialize()
{
2025-02-18 17:23:30 +08:00
Debug.LogError(FixedMainEditor.isFixedMain);
if (FixedMainEditor.isFixedMain)
{
2025-02-18 17:23:30 +08:00
Scene scene = SceneManager.GetActiveScene();
if (!scene.name.Equals("Main"))
{
SceneManager.LoadScene("Main");
}
}
}
}
2025-02-18 17:23:30 +08:00
#endif