DebuggerComponent.EnvironmentInformationWindow.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 GameFramework;
  8. using UnityEngine;
  9. #if UNITY_5_5_OR_NEWER
  10. using UnityEngine.Rendering;
  11. #endif
  12. namespace UnityGameFramework.Runtime
  13. {
  14. public sealed partial class DebuggerComponent : GameFrameworkComponent
  15. {
  16. private sealed class EnvironmentInformationWindow : ScrollableDebuggerWindowBase
  17. {
  18. private BaseComponent m_BaseComponent = null;
  19. private ResourceComponent m_ResourceComponent = null;
  20. public override void Initialize(params object[] args)
  21. {
  22. m_BaseComponent = GameEntry.GetComponent<BaseComponent>();
  23. if (m_BaseComponent == null)
  24. {
  25. Log.Fatal("Base component is invalid.");
  26. return;
  27. }
  28. m_ResourceComponent = GameEntry.GetComponent<ResourceComponent>();
  29. if (m_ResourceComponent == null)
  30. {
  31. Log.Fatal("Resource component is invalid.");
  32. return;
  33. }
  34. }
  35. protected override void OnDrawScrollableWindow()
  36. {
  37. GUILayout.Label("<b>Environment Information</b>");
  38. GUILayout.BeginVertical("box");
  39. {
  40. DrawItem("Product Name", Application.productName);
  41. DrawItem("Company Name", Application.companyName);
  42. #if UNITY_5_6_OR_NEWER
  43. DrawItem("Game Identifier", Application.identifier);
  44. #else
  45. DrawItem("Game Identifier", Application.bundleIdentifier);
  46. #endif
  47. DrawItem("Game Framework Version", Version.GameFrameworkVersion);
  48. DrawItem("Game Version", Utility.Text.Format("{0} ({1})", Version.GameVersion, Version.InternalGameVersion.ToString()));
  49. DrawItem("Resource Version", m_BaseComponent.EditorResourceMode ? "Unavailable in editor resource mode" : (string.IsNullOrEmpty(m_ResourceComponent.ApplicableGameVersion) ? "Unknown" : Utility.Text.Format("{0} ({1})", m_ResourceComponent.ApplicableGameVersion, m_ResourceComponent.InternalResourceVersion.ToString())));
  50. DrawItem("Application Version", Application.version);
  51. DrawItem("Unity Version", Application.unityVersion);
  52. DrawItem("Platform", Application.platform.ToString());
  53. DrawItem("System Language", Application.systemLanguage.ToString());
  54. DrawItem("Cloud Project Id", Application.cloudProjectId);
  55. #if UNITY_5_6_OR_NEWER
  56. DrawItem("Build Guid", Application.buildGUID);
  57. #endif
  58. DrawItem("Target Frame Rate", Application.targetFrameRate.ToString());
  59. DrawItem("Internet Reachability", Application.internetReachability.ToString());
  60. DrawItem("Background Loading Priority", Application.backgroundLoadingPriority.ToString());
  61. DrawItem("Is Playing", Application.isPlaying.ToString());
  62. #if UNITY_5_5_OR_NEWER
  63. DrawItem("Splash Screen Is Finished", SplashScreen.isFinished.ToString());
  64. #else
  65. DrawItem("Is Showing Splash Screen", Application.isShowingSplashScreen.ToString());
  66. #endif
  67. DrawItem("Run In Background", Application.runInBackground.ToString());
  68. #if UNITY_5_5_OR_NEWER
  69. DrawItem("Install Name", Application.installerName);
  70. #endif
  71. DrawItem("Install Mode", Application.installMode.ToString());
  72. DrawItem("Sandbox Type", Application.sandboxType.ToString());
  73. DrawItem("Is Mobile Platform", Application.isMobilePlatform.ToString());
  74. DrawItem("Is Console Platform", Application.isConsolePlatform.ToString());
  75. DrawItem("Is Editor", Application.isEditor.ToString());
  76. DrawItem("Is Debug Build", Debug.isDebugBuild.ToString());
  77. #if UNITY_5_6_OR_NEWER
  78. DrawItem("Is Focused", Application.isFocused.ToString());
  79. #endif
  80. #if UNITY_2018_2_OR_NEWER
  81. DrawItem("Is Batch Mode", Application.isBatchMode.ToString());
  82. #endif
  83. #if UNITY_5_3
  84. DrawItem("Stack Trace Log Type", Application.stackTraceLogType.ToString());
  85. #endif
  86. }
  87. GUILayout.EndVertical();
  88. }
  89. }
  90. }
  91. }