DebuggerComponent.InputCompassInformationWindow.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //------------------------------------------------------------
  2. // Game Framework
  3. // Copyright © 2013-2021 loyalsoft. All rights reserved.
  4. // Homepage: http://www.game7000.com/
  5. // Feedback: http://www.game7000.com/
  6. //------------------------------------------------------------
  7. using UnityEngine;
  8. namespace UnityGameFramework.Runtime
  9. {
  10. public sealed partial class DebuggerComponent : GameFrameworkComponent
  11. {
  12. private sealed class InputCompassInformationWindow : ScrollableDebuggerWindowBase
  13. {
  14. protected override void OnDrawScrollableWindow()
  15. {
  16. GUILayout.Label("<b>Input Compass Information</b>");
  17. GUILayout.BeginVertical("box");
  18. {
  19. GUILayout.BeginHorizontal();
  20. {
  21. if (GUILayout.Button("Enable", GUILayout.Height(30f)))
  22. {
  23. Input.compass.enabled = true;
  24. }
  25. if (GUILayout.Button("Disable", GUILayout.Height(30f)))
  26. {
  27. Input.compass.enabled = false;
  28. }
  29. }
  30. GUILayout.EndHorizontal();
  31. DrawItem("Enabled", Input.compass.enabled.ToString());
  32. if (Input.compass.enabled)
  33. {
  34. DrawItem("Heading Accuracy", Input.compass.headingAccuracy.ToString());
  35. DrawItem("Magnetic Heading", Input.compass.magneticHeading.ToString());
  36. DrawItem("Raw Vector", Input.compass.rawVector.ToString());
  37. DrawItem("Timestamp", Input.compass.timestamp.ToString());
  38. DrawItem("True Heading", Input.compass.trueHeading.ToString());
  39. }
  40. }
  41. GUILayout.EndVertical();
  42. }
  43. }
  44. }
  45. }