TC_GenerateEditor.cs 783 B

123456789101112131415161718192021222324252627282930
  1. using UnityEngine;
  2. using UnityEditor;
  3. using System.Collections;
  4. namespace TerrainComposer2
  5. {
  6. [CustomEditor(typeof(TC_Generate))]
  7. public class TC_GenerateEditor : Editor
  8. {
  9. void OnEnable()
  10. {
  11. Transform t = ((MonoBehaviour)target).transform;
  12. t.hideFlags = HideFlags.NotEditable | HideFlags.HideInInspector;
  13. }
  14. public override void OnInspectorGUI()
  15. {
  16. if (TC_Settings.instance == null) return;
  17. if (TC_Settings.instance.debugMode) DrawDefaultInspector(); else DrawCustomInspector();
  18. }
  19. void DrawCustomInspector()
  20. {
  21. TD.DrawSpacer();
  22. TD.DrawLabel("This script is needed for generating", 12);
  23. TD.DrawSpacer();
  24. }
  25. }
  26. }