EnviroExternalWindow.cs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. using UnityEditor;
  2. using UnityEngine;
  3. public class EnviroExternalWindow : EditorWindow
  4. {
  5. private Editor currentTimeModuleEditor, currentSkyModuleEditor, currentLightingModuleEditor, currentFogModuleEditor, currentVolumetricCloudModuleEditor,currentFlatCloudModuleEditor,currentWeatherModuleEditor,currentAuroraModuleEditor,currentLightningModuleEditor, currentAudioModuleEditor,currentEnvironmentModuleEditor,currentEffectsModuleEditor ,currentQualityModuleEditor,currentEventModuleEditor ;
  6. private Vector2 scrollPosition = Vector2.zero;
  7. // Add menu item named "My Window" to the Window menu
  8. [MenuItem("Window/Enviro/Enviro Window")]
  9. public static void ShowWindow()
  10. {
  11. //Show existing window instance. If one doesn't exist, make one.
  12. EditorWindow.GetWindow(typeof(EnviroExternalWindow));
  13. }
  14. void OnGUI()
  15. {
  16. GUILayout.Label ("Enviro 3", EditorStyles.boldLabel);
  17. scrollPosition = GUILayout.BeginScrollView(scrollPosition, false, false, GUILayout.Width(400), GUILayout.Height(600));
  18. if(Enviro.EnviroManager.instance.Time != null)
  19. {
  20. if(currentTimeModuleEditor == null)
  21. currentTimeModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Time);
  22. currentTimeModuleEditor.OnInspectorGUI();
  23. }
  24. if(Enviro.EnviroManager.instance.Lighting != null)
  25. {
  26. if(currentLightingModuleEditor == null)
  27. currentLightingModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Lighting);
  28. currentLightingModuleEditor.OnInspectorGUI();
  29. }
  30. if(Enviro.EnviroManager.instance.Sky != null)
  31. {
  32. if(currentSkyModuleEditor == null)
  33. currentSkyModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Sky);
  34. currentSkyModuleEditor.OnInspectorGUI();
  35. }
  36. if(Enviro.EnviroManager.instance.Fog != null)
  37. {
  38. if(currentFogModuleEditor == null)
  39. currentFogModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Fog);
  40. currentFogModuleEditor.OnInspectorGUI();
  41. }
  42. if(Enviro.EnviroManager.instance.VolumetricClouds != null)
  43. {
  44. if(currentVolumetricCloudModuleEditor == null)
  45. currentVolumetricCloudModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.VolumetricClouds);
  46. currentVolumetricCloudModuleEditor.OnInspectorGUI();
  47. }
  48. if(Enviro.EnviroManager.instance.FlatClouds != null)
  49. {
  50. if(currentFlatCloudModuleEditor == null)
  51. currentFlatCloudModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.FlatClouds);
  52. currentFlatCloudModuleEditor.OnInspectorGUI();
  53. }
  54. if(Enviro.EnviroManager.instance.Aurora != null)
  55. {
  56. if(currentAuroraModuleEditor == null)
  57. currentAuroraModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Aurora);
  58. currentAuroraModuleEditor.OnInspectorGUI();
  59. }
  60. if(Enviro.EnviroManager.instance.Lightning != null)
  61. {
  62. if(currentLightningModuleEditor == null)
  63. currentLightningModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Lightning);
  64. currentLightningModuleEditor.OnInspectorGUI();
  65. }
  66. if(Enviro.EnviroManager.instance.Environment != null)
  67. {
  68. if(currentEnvironmentModuleEditor == null)
  69. currentEnvironmentModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Environment);
  70. currentEnvironmentModuleEditor.OnInspectorGUI();
  71. }
  72. if(Enviro.EnviroManager.instance.Weather != null)
  73. {
  74. if(currentWeatherModuleEditor == null)
  75. currentWeatherModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Weather);
  76. currentWeatherModuleEditor.OnInspectorGUI();
  77. }
  78. if(Enviro.EnviroManager.instance.Audio != null)
  79. {
  80. if(currentAudioModuleEditor == null)
  81. currentAudioModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Audio);
  82. currentAudioModuleEditor.OnInspectorGUI();
  83. }
  84. if(Enviro.EnviroManager.instance.Effects != null)
  85. {
  86. if(currentEffectsModuleEditor == null)
  87. currentEffectsModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Effects);
  88. currentEffectsModuleEditor.OnInspectorGUI();
  89. }
  90. if(Enviro.EnviroManager.instance.Quality != null)
  91. {
  92. if(currentQualityModuleEditor == null)
  93. currentQualityModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Quality);
  94. currentQualityModuleEditor.OnInspectorGUI();
  95. }
  96. GUILayout.EndScrollView();
  97. }
  98. }