2025-09-05 19:46:30 +08:00
|
|
|
using UnityEngine;
|
2026-04-21 13:01:55 +08:00
|
|
|
using UnityEngine.UIElements;
|
2025-09-05 19:46:30 +08:00
|
|
|
|
|
|
|
|
namespace AlicizaX.Debugger.Runtime
|
|
|
|
|
{
|
|
|
|
|
public sealed partial class DebuggerComponent
|
|
|
|
|
{
|
2026-04-21 13:01:55 +08:00
|
|
|
private sealed class InputCompassInformationWindow : PollingDebuggerWindowBase
|
2025-09-05 19:46:30 +08:00
|
|
|
{
|
2026-04-21 13:01:55 +08:00
|
|
|
protected override void BuildWindow(VisualElement root)
|
2025-09-05 19:46:30 +08:00
|
|
|
{
|
2026-04-21 13:01:55 +08:00
|
|
|
VisualElement actions = CreateSection("Actions", out VisualElement actionCard);
|
|
|
|
|
VisualElement toolbar = CreateToolbarRow();
|
|
|
|
|
toolbar.Add(CreateActionButton("Enable", () => Input.compass.enabled = true, DebuggerTheme.ButtonSurface));
|
|
|
|
|
toolbar.Add(CreateActionButton("Disable", () => Input.compass.enabled = false, DebuggerTheme.ButtonSurface));
|
|
|
|
|
actionCard.Add(toolbar);
|
|
|
|
|
root.Add(actions);
|
2025-09-05 19:46:30 +08:00
|
|
|
|
2026-04-21 13:01:55 +08:00
|
|
|
VisualElement section = CreateSection("Input Compass", out VisualElement card);
|
|
|
|
|
card.Add(CreateRow("Enabled", Input.compass.enabled.ToString()));
|
|
|
|
|
if (Input.compass.enabled)
|
|
|
|
|
{
|
|
|
|
|
card.Add(CreateRow("Heading Accuracy", Input.compass.headingAccuracy.ToString()));
|
|
|
|
|
card.Add(CreateRow("Magnetic Heading", Input.compass.magneticHeading.ToString()));
|
|
|
|
|
card.Add(CreateRow("Raw Vector", Input.compass.rawVector.ToString()));
|
|
|
|
|
card.Add(CreateRow("Timestamp", Input.compass.timestamp.ToString()));
|
|
|
|
|
card.Add(CreateRow("True Heading", Input.compass.trueHeading.ToString()));
|
2025-09-05 19:46:30 +08:00
|
|
|
}
|
2026-04-21 13:01:55 +08:00
|
|
|
|
|
|
|
|
root.Add(section);
|
2025-09-05 19:46:30 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|