com.alicizax.unity.framework/Runtime/Debugger/DebuggerComponent.SceneInformationWindow.cs

36 lines
1.7 KiB
C#
Raw Normal View History

2025-09-05 19:46:30 +08:00
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UIElements;
2025-09-05 19:46:30 +08:00
namespace AlicizaX.Debugger.Runtime
{
public sealed partial class DebuggerComponent
{
private sealed class SceneInformationWindow : PollingDebuggerWindowBase
2025-09-05 19:46:30 +08:00
{
protected override void BuildWindow(VisualElement root)
2025-09-05 19:46:30 +08:00
{
VisualElement section = CreateSection("Scene Information", out VisualElement card);
card.Add(CreateRow("Scene Count", SceneManager.sceneCount.ToString()));
card.Add(CreateRow("Scene Count In Build Settings", SceneManager.sceneCountInBuildSettings.ToString()));
2025-09-05 19:46:30 +08:00
UnityEngine.SceneManagement.Scene activeScene = SceneManager.GetActiveScene();
#if UNITY_2018_3_OR_NEWER
card.Add(CreateRow("Active Scene Handle", activeScene.handle.ToString()));
#endif
card.Add(CreateRow("Active Scene Name", activeScene.name));
card.Add(CreateRow("Active Scene Path", activeScene.path));
card.Add(CreateRow("Active Scene Build Index", activeScene.buildIndex.ToString()));
card.Add(CreateRow("Active Scene Is Dirty", activeScene.isDirty.ToString()));
card.Add(CreateRow("Active Scene Is Loaded", activeScene.isLoaded.ToString()));
card.Add(CreateRow("Active Scene Is Valid", activeScene.IsValid().ToString()));
card.Add(CreateRow("Active Scene Root Count", activeScene.rootCount.ToString()));
#if UNITY_2019_1_OR_NEWER
card.Add(CreateRow("Active Scene Is Sub Scene", activeScene.isSubScene.ToString()));
#endif
root.Add(section);
2025-09-05 19:46:30 +08:00
}
}
}
}