DebuggerComponent.InputLocationInformationWindow.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //------------------------------------------------------------
  2. // Game Framework v3.x
  3. // Copyright © 2013-2017 Jiang Yin. All rights reserved.
  4. // Homepage: http://gameframework.cn/
  5. // Feedback: mailto:jiangyin@gameframework.cn
  6. //------------------------------------------------------------
  7. using UnityEngine;
  8. namespace UnityGameFramework.Runtime
  9. {
  10. public partial class DebuggerComponent
  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. DrawItem("Horizontal Accuracy:", Input.location.lastData.horizontalAccuracy.ToString());
  34. DrawItem("Vertical Accuracy:", Input.location.lastData.verticalAccuracy.ToString());
  35. DrawItem("Longitude:", Input.location.lastData.longitude.ToString());
  36. DrawItem("Latitude:", Input.location.lastData.latitude.ToString());
  37. DrawItem("Altitude:", Input.location.lastData.altitude.ToString());
  38. DrawItem("Timestamp:", Input.location.lastData.timestamp.ToString());
  39. }
  40. GUILayout.EndVertical();
  41. }
  42. }
  43. }
  44. }