DebuggerComponent.InputGyroscopeInformationWindow.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 InputGyroscopeInformationWindow : ScrollableDebuggerWindowBase
  13. {
  14. protected override void OnDrawScrollableWindow()
  15. {
  16. GUILayout.Label("<b>Input Gyroscope Information</b>");
  17. GUILayout.BeginVertical("box");
  18. {
  19. GUILayout.BeginHorizontal();
  20. {
  21. if (GUILayout.Button("Enable", GUILayout.Height(30f)))
  22. {
  23. Input.gyro.enabled = true;
  24. }
  25. if (GUILayout.Button("Disable", GUILayout.Height(30f)))
  26. {
  27. Input.gyro.enabled = false;
  28. }
  29. }
  30. GUILayout.EndHorizontal();
  31. DrawItem("Enabled:", Input.gyro.enabled.ToString());
  32. DrawItem("Update Interval:", Input.gyro.updateInterval.ToString());
  33. DrawItem("Attitude:", Input.gyro.attitude.eulerAngles.ToString());
  34. DrawItem("Gravity:", Input.gyro.gravity.ToString());
  35. DrawItem("Rotation Rate:", Input.gyro.rotationRate.ToString());
  36. DrawItem("Rotation Rate Unbiased:", Input.gyro.rotationRateUnbiased.ToString());
  37. DrawItem("User Acceleration:", Input.gyro.userAcceleration.ToString());
  38. }
  39. GUILayout.EndVertical();
  40. }
  41. }
  42. }
  43. }