multiple xr toolkit package
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

VRCSdkControlPanelSettings.cs 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEditor;
  5. using VRC.Core;
  6. public partial class VRCSdkControlPanel : EditorWindow
  7. {
  8. bool UseDevApi
  9. {
  10. get
  11. {
  12. return VRC.Core.API.GetApiUrl() == VRC.Core.API.devApiUrl;
  13. }
  14. }
  15. string clientVersionDate;
  16. string sdkVersionDate;
  17. Vector2 settingsScroll;
  18. private void Awake()
  19. {
  20. GetClientSdkVersionInformation();
  21. }
  22. public void GetClientSdkVersionInformation()
  23. {
  24. clientVersionDate = VRC.Core.SDKClientUtilities.GetTestClientVersionDate();
  25. sdkVersionDate = VRC.Core.SDKClientUtilities.GetSDKVersionDate();
  26. }
  27. public void OnConfigurationChanged()
  28. {
  29. GetClientSdkVersionInformation();
  30. }
  31. void ShowSettings()
  32. {
  33. settingsScroll = EditorGUILayout.BeginScrollView( settingsScroll, GUILayout.Width(SdkWindowWidth) );
  34. EditorGUILayout.BeginVertical(boxGuiStyle);
  35. EditorGUILayout.LabelField("Developer", EditorStyles.boldLabel);
  36. VRCSettings.Get().DisplayAdvancedSettings = EditorGUILayout.ToggleLeft("Show Extra Options on build page and account page",VRCSettings.Get().DisplayAdvancedSettings );
  37. EditorGUILayout.EndVertical();
  38. EditorGUILayout.Separator();
  39. EditorGUILayout.BeginVertical(boxGuiStyle);
  40. GUILayout.Label("Avatar Options", EditorStyles.boldLabel);
  41. bool prevShowPerfDetails = showAvatarPerformanceDetails;
  42. bool showPerfDetails = EditorGUILayout.ToggleLeft("Show All Avatar Performance Details", prevShowPerfDetails);
  43. if (showPerfDetails != prevShowPerfDetails)
  44. {
  45. showAvatarPerformanceDetails = showPerfDetails;
  46. ResetIssues();
  47. }
  48. EditorGUILayout.EndVertical();
  49. // debugging
  50. if (APIUser.CurrentUser != null && APIUser.CurrentUser.hasSuperPowers)
  51. {
  52. EditorGUILayout.Separator();
  53. EditorGUILayout.BeginVertical(boxGuiStyle);
  54. EditorGUILayout.LabelField("Logging", EditorStyles.boldLabel);
  55. // API logging
  56. {
  57. bool isLoggingEnabled = UnityEditor.EditorPrefs.GetBool("apiLoggingEnabled");
  58. bool enableLogging = EditorGUILayout.ToggleLeft("API Logging Enabled", isLoggingEnabled);
  59. if (enableLogging != isLoggingEnabled)
  60. {
  61. if (enableLogging)
  62. VRC.Core.Logger.AddDebugLevel(DebugLevel.API);
  63. else
  64. VRC.Core.Logger.RemoveDebugLevel(DebugLevel.API);
  65. UnityEditor.EditorPrefs.SetBool("apiLoggingEnabled", enableLogging);
  66. }
  67. }
  68. // All logging
  69. {
  70. bool isLoggingEnabled = UnityEditor.EditorPrefs.GetBool("allLoggingEnabled");
  71. bool enableLogging = EditorGUILayout.ToggleLeft("All Logging Enabled", isLoggingEnabled);
  72. if (enableLogging != isLoggingEnabled)
  73. {
  74. if (enableLogging)
  75. VRC.Core.Logger.AddDebugLevel(DebugLevel.All);
  76. else
  77. VRC.Core.Logger.RemoveDebugLevel(DebugLevel.All);
  78. UnityEditor.EditorPrefs.SetBool("allLoggingEnabled", enableLogging);
  79. }
  80. }
  81. EditorGUILayout.EndVertical();
  82. }
  83. else
  84. {
  85. if (UnityEditor.EditorPrefs.GetBool("apiLoggingEnabled"))
  86. UnityEditor.EditorPrefs.SetBool("apiLoggingEnabled", false);
  87. if (UnityEditor.EditorPrefs.GetBool("allLoggingEnabled"))
  88. UnityEditor.EditorPrefs.SetBool("allLoggingEnabled", false);
  89. }
  90. // Future proof upload
  91. {
  92. EditorGUILayout.Separator();
  93. EditorGUILayout.BeginVertical(boxGuiStyle);
  94. EditorGUILayout.LabelField("Publish", EditorStyles.boldLabel);
  95. bool futureProofPublish = UnityEditor.EditorPrefs.GetBool("futureProofPublish", DefaultFutureProofPublishEnabled);
  96. futureProofPublish = EditorGUILayout.ToggleLeft("Future Proof Publish", futureProofPublish);
  97. if (UnityEditor.EditorPrefs.GetBool("futureProofPublish", DefaultFutureProofPublishEnabled) != futureProofPublish)
  98. {
  99. UnityEditor.EditorPrefs.SetBool("futureProofPublish", futureProofPublish);
  100. }
  101. EditorGUILayout.LabelField("Client Version Date", clientVersionDate);
  102. EditorGUILayout.LabelField("SDK Version Date", sdkVersionDate);
  103. EditorGUILayout.EndVertical();
  104. }
  105. if (APIUser.CurrentUser != null)
  106. {
  107. EditorGUILayout.Separator();
  108. EditorGUILayout.BeginVertical(boxGuiStyle);
  109. // custom vrchat install location
  110. OnVRCInstallPathGUI();
  111. EditorGUILayout.EndVertical();
  112. }
  113. EditorGUILayout.EndScrollView();
  114. }
  115. static void OnVRCInstallPathGUI()
  116. {
  117. EditorGUILayout.LabelField("VRChat Client", EditorStyles.boldLabel);
  118. EditorGUILayout.LabelField("Installed Client Path: ", clientInstallPath);
  119. EditorGUILayout.BeginHorizontal();
  120. GUILayout.Label("");
  121. if (GUILayout.Button("Edit"))
  122. {
  123. string initPath = "";
  124. if (!string.IsNullOrEmpty(clientInstallPath))
  125. initPath = clientInstallPath;
  126. clientInstallPath = EditorUtility.OpenFilePanel("Choose VRC Client Exe", initPath, "exe");
  127. SDKClientUtilities.SetVRCInstallPath(clientInstallPath);
  128. window.OnConfigurationChanged();
  129. }
  130. if (GUILayout.Button("Revert to Default"))
  131. {
  132. clientInstallPath = SDKClientUtilities.LoadRegistryVRCInstallPath();
  133. window.OnConfigurationChanged();
  134. }
  135. EditorGUILayout.EndHorizontal();
  136. EditorGUILayout.Separator();
  137. }
  138. }