DebuggerComponent.InputLocationInformationWindow.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 InputLocationInformationWindow : ScrollableDebuggerWindowBase
  13. {
  14. protected override void OnDrawScrollableWindow()
  15. {
  16. GUILayout.Label("<b>Input Location Information</b>");
  17. GUILayout.BeginVertical("box");
  18. {
  19. GUILayout.BeginHorizontal();
  20. {
  21. if (GUILayout.Button("Enable", GUILayout.Height(30f)))
  22. {
  23. Input.location.Start();
  24. }
  25. if (GUILayout.Button("Disable", GUILayout.Height(30f)))
  26. {
  27. Input.location.Stop();
  28. }
  29. }
  30. GUILayout.EndHorizontal();
  31. DrawItem("Is Enabled By User", Input.location.isEnabledByUser.ToString());
  32. DrawItem("Status", Input.location.status.ToString());
  33. if (Input.location.status == LocationServiceStatus.Running)
  34. {
  35. DrawItem("Horizontal Accuracy", Input.location.lastData.horizontalAccuracy.ToString());
  36. DrawItem("Vertical Accuracy", Input.location.lastData.verticalAccuracy.ToString());
  37. DrawItem("Longitude", Input.location.lastData.longitude.ToString());
  38. DrawItem("Latitude", Input.location.lastData.latitude.ToString());
  39. DrawItem("Altitude", Input.location.lastData.altitude.ToString());
  40. DrawItem("Timestamp", Input.location.lastData.timestamp.ToString());
  41. }
  42. }
  43. GUILayout.EndVertical();
  44. }
  45. }
  46. }
  47. }