SettingsEditor.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #if !DISABLE_SRDEBUGGER
  2. using UnityEditor;
  3. using UnityEngine;
  4. namespace SRDebugger.Editor
  5. {
  6. [CustomEditor(typeof (Settings))]
  7. class SettingsEditor : UnityEditor.Editor
  8. {
  9. private bool _override;
  10. public override void OnInspectorGUI()
  11. {
  12. SRInternalEditorUtil.DrawLogo(SRInternalEditorUtil.GetLogo());
  13. GUILayout.Label(
  14. "This asset contains the runtime settings used by SRDebugger. It is recommended that this asset be edited only via the SRDebugger Settings window.",
  15. EditorStyles.wordWrappedLabel);
  16. EditorGUILayout.Separator();
  17. if (GUILayout.Button("Open SRDebugger Settings Window"))
  18. {
  19. SRDebuggerSettingsWindow.Open();
  20. }
  21. if (!_override)
  22. {
  23. if (GUILayout.Button("Override Warning"))
  24. {
  25. _override = true;
  26. }
  27. }
  28. else
  29. {
  30. GUILayout.Label(
  31. "You have been warned...",
  32. EditorStyles.wordWrappedLabel);
  33. }
  34. EditorGUILayout.Separator();
  35. if (_override)
  36. {
  37. base.OnInspectorGUI();
  38. }
  39. }
  40. }
  41. }
  42. #endif