add weather and time
This commit is contained in:
@@ -0,0 +1,234 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEditor.Build;
|
||||
|
||||
public class EnviroBaseInspector : Editor
|
||||
{
|
||||
public SerializedObject serializedObj;
|
||||
public GUIStyle boxStyle;
|
||||
public GUIStyle boxStyleModified;
|
||||
public GUIStyle wrapStyle;
|
||||
public GUIStyle headerStyle;
|
||||
public GUIStyle headerStyleMid;
|
||||
public GUIStyle headerFoldout;
|
||||
public GUIStyle popUpStyle;
|
||||
public GUIStyle integrationBox;
|
||||
public GUIStyle helpButton;
|
||||
public bool showHelpBox;
|
||||
|
||||
public Color baseModuleColor = new Color(0.0f, 0.0f, 0.5f, 1f);
|
||||
public Color categoryModuleColor = new Color(0.5f, 0.5f, 0.0f, 1f);
|
||||
public Color thirdPartyModuleColor = new Color(0.0f, 0.5f, 0.5f, 1f);
|
||||
|
||||
public void SetupGUIStyles()
|
||||
{
|
||||
if (boxStyle == null)
|
||||
{
|
||||
boxStyle = new GUIStyle(GUI.skin.box);
|
||||
boxStyle.normal.textColor = GUI.skin.label.normal.textColor;
|
||||
boxStyle.fontStyle = FontStyle.Bold;
|
||||
boxStyle.alignment = TextAnchor.UpperLeft;
|
||||
}
|
||||
|
||||
if (boxStyleModified == null)
|
||||
{
|
||||
boxStyleModified = new GUIStyle(EditorStyles.helpBox);
|
||||
boxStyleModified.normal.textColor = GUI.skin.label.normal.textColor;
|
||||
boxStyleModified.fontStyle = FontStyle.Bold;
|
||||
boxStyleModified.fontSize = 11;
|
||||
boxStyleModified.alignment = TextAnchor.UpperLeft;
|
||||
}
|
||||
|
||||
if (integrationBox == null)
|
||||
{
|
||||
integrationBox = new GUIStyle(EditorStyles.helpBox);
|
||||
integrationBox.fontStyle = FontStyle.Bold;
|
||||
integrationBox.fontSize = 11;
|
||||
}
|
||||
|
||||
if (wrapStyle == null)
|
||||
{
|
||||
wrapStyle = new GUIStyle(GUI.skin.label);
|
||||
wrapStyle.fontStyle = FontStyle.Normal;
|
||||
wrapStyle.wordWrap = true;
|
||||
}
|
||||
|
||||
if (headerStyle == null)
|
||||
{
|
||||
headerStyle = new GUIStyle(GUI.skin.label);
|
||||
headerStyle.fontStyle = FontStyle.Bold;
|
||||
headerStyle.alignment = TextAnchor.UpperLeft;
|
||||
}
|
||||
|
||||
if (headerStyleMid == null)
|
||||
{
|
||||
headerStyleMid = new GUIStyle(GUI.skin.label);
|
||||
headerStyleMid.fontStyle = FontStyle.Bold;
|
||||
headerStyleMid.alignment = TextAnchor.MiddleCenter;
|
||||
}
|
||||
|
||||
if (headerFoldout == null)
|
||||
{
|
||||
headerFoldout = new GUIStyle(EditorStyles.foldout);
|
||||
headerFoldout.fontStyle = FontStyle.Bold;
|
||||
}
|
||||
|
||||
if (popUpStyle == null)
|
||||
{
|
||||
popUpStyle = new GUIStyle(EditorStyles.popup);
|
||||
popUpStyle.alignment = TextAnchor.MiddleCenter;
|
||||
popUpStyle.fixedHeight = 20f;
|
||||
popUpStyle.fontStyle = FontStyle.Bold;
|
||||
}
|
||||
|
||||
if (helpButton == null)
|
||||
{
|
||||
helpButton = new GUIStyle(EditorStyles.miniButtonRight);
|
||||
//helpButton.alignment = TextAnchor.UpperRight;
|
||||
helpButton.margin = new RectOffset(100, 0, 0, 0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void RenderHelpBoxButton()
|
||||
{
|
||||
//Help Box Button
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
GUILayout.FlexibleSpace();
|
||||
if (GUILayout.Button("?", EditorStyles.miniButton, GUILayout.Width(20), GUILayout.Height(20)))
|
||||
{
|
||||
if (showHelpBox)
|
||||
showHelpBox = false;
|
||||
else
|
||||
showHelpBox = true;
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
//End Help Box Button
|
||||
}
|
||||
|
||||
public void RenderHelpBox(string content)
|
||||
{
|
||||
// GUILayout.BeginVertical("",EditorStyles.helpBox);
|
||||
GUILayout.Label(content, EditorStyles.helpBox);
|
||||
}
|
||||
|
||||
public void RenderIntegrationTextBox(string content)
|
||||
{
|
||||
// GUILayout.BeginVertical("",EditorStyles.helpBox);
|
||||
GUILayout.Label(content, integrationBox);
|
||||
}
|
||||
|
||||
public void RenderDisableInputBox()
|
||||
{
|
||||
if (Enviro.EnviroManager.instance != null)
|
||||
{
|
||||
if (Enviro.EnviroManager.instance.Weather != null && Enviro.EnviroManager.instance.Quality != null)
|
||||
{
|
||||
//both
|
||||
GUILayout.Label("Some settings are controlled from weather and quality modules!", EditorStyles.helpBox);
|
||||
}
|
||||
else if (Enviro.EnviroManager.instance.Weather != null && Enviro.EnviroManager.instance.Quality == null)
|
||||
{
|
||||
//Weather Only
|
||||
GUILayout.Label("Some settings are controlled from weather modules!", EditorStyles.helpBox);
|
||||
}
|
||||
else if (Enviro.EnviroManager.instance.Weather == null && Enviro.EnviroManager.instance.Quality != null)
|
||||
{
|
||||
// Quality Only
|
||||
GUILayout.Label("Some settings are controlled from quality modules!", EditorStyles.helpBox);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Show Nothing
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void ApplyChanges()
|
||||
{
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
serializedObj.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddDefineSymbol(string symbol)
|
||||
{
|
||||
var targets = Enum.GetValues(typeof(BuildTargetGroup))
|
||||
.Cast<BuildTargetGroup>()
|
||||
.Where(x => x != BuildTargetGroup.Unknown)
|
||||
.Where(x => !IsObsolete(x));
|
||||
|
||||
foreach (var target in targets)
|
||||
{
|
||||
#if UNITY_6000_0_OR_NEWER
|
||||
var namedTarget = NamedBuildTarget.FromBuildTargetGroup(target);
|
||||
var defines = PlayerSettings.GetScriptingDefineSymbols(namedTarget).Trim();
|
||||
#else
|
||||
var defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(target).Trim();
|
||||
#endif
|
||||
|
||||
var list = defines.Split(new[] { ';', ' ' }, StringSplitOptions.RemoveEmptyEntries)
|
||||
.ToList();
|
||||
|
||||
if (list.Contains(symbol))
|
||||
continue;
|
||||
|
||||
list.Add(symbol);
|
||||
defines = string.Join(";", list);
|
||||
|
||||
#if UNITY_6000_0_OR_NEWER
|
||||
PlayerSettings.SetScriptingDefineSymbols(namedTarget, defines);
|
||||
#else
|
||||
PlayerSettings.SetScriptingDefineSymbolsForGroup(target, defines);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsObsolete(BuildTargetGroup group)
|
||||
{
|
||||
var field = typeof(BuildTargetGroup).GetField(group.ToString());
|
||||
if (field == null)
|
||||
return false;
|
||||
|
||||
var attrs = field.GetCustomAttributes(typeof(ObsoleteAttribute), false);
|
||||
return attrs != null && attrs.Length > 0;
|
||||
}
|
||||
|
||||
public static void RemoveDefineSymbol(string symbol)
|
||||
{
|
||||
var targets = Enum.GetValues(typeof(BuildTargetGroup))
|
||||
.Cast<BuildTargetGroup>()
|
||||
.Where(x => x != BuildTargetGroup.Unknown)
|
||||
.Where(x => !IsObsolete(x));
|
||||
|
||||
foreach (var target in targets)
|
||||
{
|
||||
#if UNITY_6000_0_OR_NEWER
|
||||
var namedTarget = NamedBuildTarget.FromBuildTargetGroup(target);
|
||||
var defines = PlayerSettings.GetScriptingDefineSymbols(namedTarget).Trim();
|
||||
#else
|
||||
var defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(target).Trim();
|
||||
#endif
|
||||
var list = defines.Split(new[] { ';', ' ' }, StringSplitOptions.RemoveEmptyEntries)
|
||||
.ToList();
|
||||
|
||||
if (list.Contains(symbol))
|
||||
{
|
||||
list.RemoveAll(s => s == symbol);
|
||||
defines = string.Join(";", list);
|
||||
|
||||
#if UNITY_6000_0_OR_NEWER
|
||||
PlayerSettings.SetScriptingDefineSymbols(namedTarget, defines);
|
||||
#else
|
||||
PlayerSettings.SetScriptingDefineSymbolsForGroup(target, defines);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 26dd26530f29ea04ebc5387cdebeebb8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 236601
|
||||
packageName: Enviro 3 - Sky and Weather
|
||||
packageVersion: 3.1.2
|
||||
assetPath: Assets/Enviro 3 - Sky and Weather/Scripts/Editor/Base/EnviroBaseInspector.cs
|
||||
uploadId: 660896
|
||||
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
|
||||
[InitializeOnLoad]
|
||||
sealed class EnviroDefineSymbol
|
||||
{
|
||||
const string k_Define = "ENVIRO_3";
|
||||
|
||||
static EnviroDefineSymbol()
|
||||
{
|
||||
var targets = Enum.GetValues(typeof(BuildTargetGroup))
|
||||
.Cast<BuildTargetGroup>()
|
||||
.Where(x => x != BuildTargetGroup.Unknown)
|
||||
.Where(x => !IsObsolete(x));
|
||||
|
||||
foreach (var target in targets)
|
||||
{
|
||||
#if UNITY_6000_0_OR_NEWER
|
||||
var namedTarget = NamedBuildTarget.FromBuildTargetGroup(target);
|
||||
var defines = PlayerSettings.GetScriptingDefineSymbols(namedTarget).Trim();
|
||||
#else
|
||||
var defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(target).Trim();
|
||||
#endif
|
||||
|
||||
var list = defines.Split(new[] { ';', ' ' }, StringSplitOptions.RemoveEmptyEntries)
|
||||
.ToList();
|
||||
|
||||
if (list.Contains(k_Define))
|
||||
continue;
|
||||
|
||||
list.Add(k_Define);
|
||||
defines = string.Join(";", list);
|
||||
|
||||
#if UNITY_6000_0_OR_NEWER
|
||||
PlayerSettings.SetScriptingDefineSymbols(namedTarget, defines);
|
||||
#else
|
||||
PlayerSettings.SetScriptingDefineSymbolsForGroup(target, defines);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static bool IsObsolete(BuildTargetGroup group)
|
||||
{
|
||||
var attrs = typeof(BuildTargetGroup)
|
||||
.GetField(group.ToString())
|
||||
.GetCustomAttributes(typeof(ObsoleteAttribute), false);
|
||||
|
||||
return attrs != null && attrs.Length > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: acd2282461352664089464b90bd1f257
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 236601
|
||||
packageName: Enviro 3 - Sky and Weather
|
||||
packageVersion: 3.1.2
|
||||
assetPath: Assets/Enviro 3 - Sky and Weather/Scripts/Editor/Base/EnviroDefineSymbol.cs
|
||||
uploadId: 660896
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 774b18065cd193747aafe1db9db10291
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 236601
|
||||
packageName: Enviro 3 - Sky and Weather
|
||||
packageVersion: 3.1.2
|
||||
assetPath: Assets/Enviro 3 - Sky and Weather/Scripts/Editor/Base/EnviroEditorUtilities.cs
|
||||
uploadId: 660896
|
||||
@@ -0,0 +1,124 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEditorInternal;
|
||||
|
||||
namespace Enviro
|
||||
{
|
||||
[CustomEditor(typeof(Enviro.EnviroEffectRemovalZone))]
|
||||
public class EnviroEffectRemovalZoneEditor : Editor {
|
||||
|
||||
GUIStyle boxStyle;
|
||||
GUIStyle boxStyleModified;
|
||||
GUIStyle wrapStyle;
|
||||
GUIStyle wrapStyle2;
|
||||
GUIStyle clearStyle;
|
||||
|
||||
Enviro.EnviroEffectRemovalZone myTarget;
|
||||
|
||||
private Color boxColor1;
|
||||
|
||||
SerializedObject serializedObj;
|
||||
|
||||
private SerializedProperty type, density, radius, stretch, feather, size;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
myTarget = (Enviro.EnviroEffectRemovalZone)target;
|
||||
serializedObj = new SerializedObject (myTarget);
|
||||
boxColor1 = new Color(0.95f, 0.95f, 0.95f,1f);
|
||||
type = serializedObj.FindProperty("type");
|
||||
density = serializedObj.FindProperty("density");
|
||||
radius = serializedObj.FindProperty("radius");
|
||||
stretch = serializedObj.FindProperty("stretch");
|
||||
feather = serializedObj.FindProperty("feather");
|
||||
size = serializedObj.FindProperty("size");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
|
||||
//Set up the box style
|
||||
if (boxStyle == null)
|
||||
{
|
||||
boxStyle = new GUIStyle(GUI.skin.box);
|
||||
boxStyle.normal.textColor = GUI.skin.label.normal.textColor;
|
||||
boxStyle.fontStyle = FontStyle.Bold;
|
||||
boxStyle.alignment = TextAnchor.UpperLeft;
|
||||
}
|
||||
|
||||
if (boxStyleModified == null)
|
||||
{
|
||||
boxStyleModified = new GUIStyle(EditorStyles.helpBox);
|
||||
boxStyleModified.normal.textColor = GUI.skin.label.normal.textColor;
|
||||
boxStyleModified.fontStyle = FontStyle.Bold;
|
||||
boxStyleModified.fontSize = 11;
|
||||
boxStyleModified.alignment = TextAnchor.UpperLeft;
|
||||
}
|
||||
|
||||
//Setup the wrap style
|
||||
if (wrapStyle == null)
|
||||
{
|
||||
wrapStyle = new GUIStyle(GUI.skin.label);
|
||||
wrapStyle.fontStyle = FontStyle.Bold;
|
||||
wrapStyle.wordWrap = true;
|
||||
}
|
||||
|
||||
if (wrapStyle2 == null)
|
||||
{
|
||||
wrapStyle2 = new GUIStyle(GUI.skin.label);
|
||||
wrapStyle2.fontStyle = FontStyle.Normal;
|
||||
wrapStyle2.wordWrap = true;
|
||||
}
|
||||
|
||||
if (clearStyle == null) {
|
||||
clearStyle = new GUIStyle(GUI.skin.label);
|
||||
clearStyle.normal.textColor = GUI.skin.label.normal.textColor;
|
||||
clearStyle.fontStyle = FontStyle.Bold;
|
||||
clearStyle.alignment = TextAnchor.UpperRight;
|
||||
}
|
||||
|
||||
|
||||
GUILayout.BeginVertical(" Enviro - Effect Removal Zone", boxStyle);
|
||||
GUILayout.Space(30);
|
||||
GUI.backgroundColor = boxColor1;
|
||||
GUILayout.BeginVertical("Information", boxStyleModified);
|
||||
GUI.backgroundColor = Color.white;
|
||||
GUILayout.Space(20);
|
||||
EditorGUILayout.LabelField("Use this component to hide fog and weather particles for example for indoor areas.", wrapStyle2);
|
||||
GUILayout.EndVertical();
|
||||
GUI.backgroundColor = boxColor1;
|
||||
GUILayout.BeginVertical("", boxStyleModified);
|
||||
GUI.backgroundColor = Color.white;
|
||||
GUILayout.Space(20);
|
||||
///////
|
||||
EditorGUI.BeginChangeCheck();
|
||||
EditorGUILayout.PropertyField(type);
|
||||
GUILayout.Space(5);
|
||||
EditorGUILayout.PropertyField(density);
|
||||
EditorGUILayout.PropertyField(feather);
|
||||
GUILayout.Space(5);
|
||||
if(myTarget.type == Enviro.EnviroEffectRemovalZone.Mode.Spherical)
|
||||
{
|
||||
EditorGUILayout.PropertyField(radius);
|
||||
EditorGUILayout.PropertyField(stretch);
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.PropertyField(size);
|
||||
}
|
||||
|
||||
if (EditorGUI.EndChangeCheck ())
|
||||
{
|
||||
serializedObj.ApplyModifiedProperties ();
|
||||
}
|
||||
|
||||
///////
|
||||
GUILayout.EndVertical();
|
||||
|
||||
// END
|
||||
EditorGUILayout.EndVertical ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e6f1253382157204b968392ce8d09f83
|
||||
timeCreated: 1497912081
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 236601
|
||||
packageName: Enviro 3 - Sky and Weather
|
||||
packageVersion: 3.1.2
|
||||
assetPath: Assets/Enviro 3 - Sky and Weather/Scripts/Editor/Base/EnviroEffectRemovalZoneEditor.cs
|
||||
uploadId: 660896
|
||||
@@ -0,0 +1,134 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public class EnviroExternalWindow : EditorWindow
|
||||
{
|
||||
private Editor currentTimeModuleEditor, currentSkyModuleEditor, currentLightingModuleEditor, currentFogModuleEditor, currentVolumetricCloudModuleEditor,currentFlatCloudModuleEditor,currentWeatherModuleEditor,currentAuroraModuleEditor,currentLightningModuleEditor, currentAudioModuleEditor,currentEnvironmentModuleEditor,currentEffectsModuleEditor ,currentQualityModuleEditor,currentEventModuleEditor ;
|
||||
private Vector2 scrollPosition = Vector2.zero;
|
||||
// Add menu item named "My Window" to the Window menu
|
||||
[MenuItem("Window/Enviro/Enviro Window")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
//Show existing window instance. If one doesn't exist, make one.
|
||||
EditorWindow.GetWindow(typeof(EnviroExternalWindow));
|
||||
}
|
||||
|
||||
void OnGUI()
|
||||
{
|
||||
if (Enviro.EnviroManager.instance == null)
|
||||
{
|
||||
GUILayout.Label ("Enviro 3 not in Scene. Please use this window in a Scene with Enviro 3.", EditorStyles.boldLabel);
|
||||
return;
|
||||
}
|
||||
|
||||
GUILayout.Label ("Enviro 3", EditorStyles.boldLabel);
|
||||
|
||||
scrollPosition = GUILayout.BeginScrollView(scrollPosition, false, false, GUILayout.Width(400), GUILayout.Height(600));
|
||||
|
||||
if(Enviro.EnviroManager.instance.Time != null)
|
||||
{
|
||||
if(currentTimeModuleEditor == null)
|
||||
currentTimeModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Time);
|
||||
|
||||
currentTimeModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(Enviro.EnviroManager.instance.Lighting != null)
|
||||
{
|
||||
if(currentLightingModuleEditor == null)
|
||||
currentLightingModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Lighting);
|
||||
|
||||
currentLightingModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(Enviro.EnviroManager.instance.Sky != null)
|
||||
{
|
||||
if(currentSkyModuleEditor == null)
|
||||
currentSkyModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Sky);
|
||||
|
||||
currentSkyModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(Enviro.EnviroManager.instance.Fog != null)
|
||||
{
|
||||
if(currentFogModuleEditor == null)
|
||||
currentFogModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Fog);
|
||||
|
||||
currentFogModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(Enviro.EnviroManager.instance.VolumetricClouds != null)
|
||||
{
|
||||
if(currentVolumetricCloudModuleEditor == null)
|
||||
currentVolumetricCloudModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.VolumetricClouds);
|
||||
|
||||
currentVolumetricCloudModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(Enviro.EnviroManager.instance.FlatClouds != null)
|
||||
{
|
||||
if(currentFlatCloudModuleEditor == null)
|
||||
currentFlatCloudModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.FlatClouds);
|
||||
|
||||
currentFlatCloudModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(Enviro.EnviroManager.instance.Aurora != null)
|
||||
{
|
||||
if(currentAuroraModuleEditor == null)
|
||||
currentAuroraModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Aurora);
|
||||
|
||||
currentAuroraModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(Enviro.EnviroManager.instance.Lightning != null)
|
||||
{
|
||||
if(currentLightningModuleEditor == null)
|
||||
currentLightningModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Lightning);
|
||||
|
||||
currentLightningModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(Enviro.EnviroManager.instance.Environment != null)
|
||||
{
|
||||
if(currentEnvironmentModuleEditor == null)
|
||||
currentEnvironmentModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Environment);
|
||||
|
||||
currentEnvironmentModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(Enviro.EnviroManager.instance.Weather != null)
|
||||
{
|
||||
if(currentWeatherModuleEditor == null)
|
||||
currentWeatherModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Weather);
|
||||
|
||||
currentWeatherModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(Enviro.EnviroManager.instance.Audio != null)
|
||||
{
|
||||
if(currentAudioModuleEditor == null)
|
||||
currentAudioModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Audio);
|
||||
|
||||
currentAudioModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(Enviro.EnviroManager.instance.Effects != null)
|
||||
{
|
||||
if(currentEffectsModuleEditor == null)
|
||||
currentEffectsModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Effects);
|
||||
|
||||
currentEffectsModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(Enviro.EnviroManager.instance.Quality != null)
|
||||
{
|
||||
if(currentQualityModuleEditor == null)
|
||||
currentQualityModuleEditor = Editor.CreateEditor(Enviro.EnviroManager.instance.Quality);
|
||||
|
||||
currentQualityModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
GUILayout.EndScrollView();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 052eb9141011c8e4f841010cd4af5146
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 236601
|
||||
packageName: Enviro 3 - Sky and Weather
|
||||
packageVersion: 3.1.2
|
||||
assetPath: Assets/Enviro 3 - Sky and Weather/Scripts/Editor/Base/EnviroExternalWindow.cs
|
||||
uploadId: 660896
|
||||
@@ -0,0 +1,575 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Enviro{
|
||||
[CustomEditor(typeof(EnviroManager))]
|
||||
public class EnviroManagerInspector : EnviroBaseInspector
|
||||
{
|
||||
private EnviroManager myTarget;
|
||||
|
||||
private Editor currentTimeModuleEditor, currentSkyModuleEditor, currentLightingModuleEditor, currentReflectionsModuleEditor, currentFogModuleEditor, currentVolumetricCloudModuleEditor,currentFlatCloudModuleEditor,currentWeatherModuleEditor,currentAuroraModuleEditor,currentLightningModuleEditor, currentAudioModuleEditor,currentEnvironmentModuleEditor,currentEffectsModuleEditor ,currentQualityModuleEditor;
|
||||
private SerializedProperty configuration, modules, Camera, CameraTag, dontDestroyOnLoad ,worldAnchor ,optionalFollowTransform;
|
||||
private SerializedProperty sunRotationX,sunRotationY,moonRotationX,moonRotationY,dayNightSwitch;
|
||||
//Events
|
||||
private SerializedProperty onHourPassedActions, onDayPassedActions, onYearPassedActions, onWeatherChangedActions, onSeasonChangedActions, onNightActions, onDayActions;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
myTarget = (EnviroManager)target;
|
||||
serializedObj = new SerializedObject(myTarget);
|
||||
configuration = serializedObj.FindProperty("configuration");
|
||||
Camera = serializedObj.FindProperty("Camera");
|
||||
CameraTag = serializedObj.FindProperty("CameraTag");
|
||||
dontDestroyOnLoad = serializedObj.FindProperty("dontDestroyOnLoad");
|
||||
sunRotationX = serializedObj.FindProperty("sunRotationX");
|
||||
sunRotationY = serializedObj.FindProperty("sunRotationY");
|
||||
moonRotationX = serializedObj.FindProperty("moonRotationX");
|
||||
moonRotationY = serializedObj.FindProperty("moonRotationY");
|
||||
dayNightSwitch = serializedObj.FindProperty("dayNightSwitch");
|
||||
worldAnchor = serializedObj.FindProperty("Objects.worldAnchor");
|
||||
optionalFollowTransform = serializedObj.FindProperty("optionalFollowTransform");
|
||||
//Events
|
||||
onHourPassedActions = serializedObj.FindProperty("Events.onHourPassedActions");
|
||||
onDayPassedActions = serializedObj.FindProperty("Events.onDayPassedActions");
|
||||
onYearPassedActions = serializedObj.FindProperty("Events.onYearPassedActions");
|
||||
onWeatherChangedActions = serializedObj.FindProperty("Events.onWeatherChangedActions");
|
||||
onSeasonChangedActions = serializedObj.FindProperty("Events.onSeasonChangedActions");
|
||||
onNightActions = serializedObj.FindProperty("Events.onNightActions");
|
||||
onDayActions = serializedObj.FindProperty("Events.onDayActions");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
SetupGUIStyles();
|
||||
|
||||
GUILayout.BeginVertical("", boxStyle);
|
||||
GUILayout.Label("Enviro - Sky and Weather Manager",headerStyleMid);
|
||||
GUILayout.Space(5);
|
||||
GUILayout.Label("Version: " + myTarget.version, headerStyleMid);
|
||||
|
||||
|
||||
//Help Box Button
|
||||
//RenderHelpBoxButton();
|
||||
|
||||
// if(showHelpBox)
|
||||
// RenderHelpBox("This is a help text test!");
|
||||
|
||||
GUILayout.EndVertical();
|
||||
|
||||
GUILayout.BeginVertical("",boxStyle);
|
||||
myTarget.showSetup = GUILayout.Toggle(myTarget.showSetup, "Setup", headerFoldout);
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
||||
if(myTarget.showSetup)
|
||||
{
|
||||
GUILayout.BeginVertical("",boxStyleModified);
|
||||
GUILayout.Label("Camera Setup", headerStyle);
|
||||
|
||||
// GUILayout.Space(10);
|
||||
// GUILayout.Label("Main Camera", headerStyle);
|
||||
EditorGUILayout.PropertyField(Camera);
|
||||
|
||||
if(myTarget.Camera == null)
|
||||
CameraTag.stringValue = EditorGUILayout.TagField("Camera Tag", CameraTag.stringValue);
|
||||
|
||||
GUILayout.Space(10);
|
||||
GUILayout.Label("Additional Cameras", headerStyle);
|
||||
GUILayout.Space(5);
|
||||
if (GUILayout.Button ("Add"))
|
||||
{
|
||||
myTarget.Cameras.Add (new EnviroCameras());
|
||||
}
|
||||
GUILayout.Space(5);
|
||||
for (int i = 0; i < myTarget.Cameras.Count; i++)
|
||||
{
|
||||
GUILayout.BeginVertical("", boxStyleModified);
|
||||
myTarget.Cameras[i].camera = (Camera)EditorGUILayout.ObjectField ("Camera", myTarget.Cameras[i].camera, typeof(Camera), true);
|
||||
myTarget.Cameras[i].quality = (EnviroQuality)EditorGUILayout.ObjectField ("Quality", myTarget.Cameras[i].quality, typeof(EnviroQuality), true);
|
||||
myTarget.Cameras[i].resetMatrix = EditorGUILayout.Toggle("Reset Matrix", myTarget.Cameras[i].resetMatrix);
|
||||
|
||||
if (GUILayout.Button ("Remove"))
|
||||
{
|
||||
myTarget.Cameras.RemoveAt (i);
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
|
||||
GUILayout.BeginVertical("",boxStyleModified);
|
||||
GUILayout.Label("General Setup", headerStyle);
|
||||
EditorGUILayout.PropertyField(dontDestroyOnLoad);
|
||||
EditorGUILayout.PropertyField(worldAnchor);
|
||||
EditorGUILayout.PropertyField(optionalFollowTransform);
|
||||
GUILayout.EndVertical();
|
||||
|
||||
GUILayout.BeginVertical("", boxStyleModified);
|
||||
|
||||
#if ENVIRO_HDRP
|
||||
GUILayout.Label("Render Pipeline: HDRP", headerStyle);
|
||||
#elif ENVIRO_URP
|
||||
GUILayout.Label("Render Pipeline: URP", headerStyle);
|
||||
#else
|
||||
GUILayout.Label("Render Pipeline: Legacy", headerStyle);
|
||||
#endif
|
||||
|
||||
GUILayout.Space(10);
|
||||
#if !ENVIRO_HDRP
|
||||
if (GUILayout.Button("Activate HDRP Support"))
|
||||
{
|
||||
AddDefineSymbol("ENVIRO_HDRP");
|
||||
RemoveDefineSymbol("ENVIRO_URP");
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !ENVIRO_URP
|
||||
if (GUILayout.Button("Activate URP Support"))
|
||||
{
|
||||
AddDefineSymbol("ENVIRO_URP");
|
||||
RemoveDefineSymbol("ENVIRO_HDRP");
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENVIRO_URP || ENVIRO_HDRP
|
||||
if (GUILayout.Button("Activate Legacy Support"))
|
||||
{
|
||||
RemoveDefineSymbol("ENVIRO_URP");
|
||||
RemoveDefineSymbol("ENVIRO_HDRP");
|
||||
}
|
||||
#endif
|
||||
GUILayout.EndVertical();
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
|
||||
GUILayout.BeginVertical("", boxStyle);
|
||||
myTarget.showModules = GUILayout.Toggle(myTarget.showModules, "Modules", headerFoldout);
|
||||
if(myTarget.showModules)
|
||||
{
|
||||
|
||||
if(myTarget.configuration == null)
|
||||
{
|
||||
GUILayout.Label("Please assign or create a new configuration.");
|
||||
EditorGUILayout.PropertyField(configuration);
|
||||
if(GUILayout.Button("Create new Configuration"))
|
||||
{
|
||||
myTarget.configuration = EnviroConfigurationCreation.CreateMyAsset();
|
||||
serializedObj.Update();
|
||||
}
|
||||
}
|
||||
else if (myTarget.version != myTarget.configuration.version)
|
||||
{
|
||||
EditorGUILayout.PropertyField(configuration);
|
||||
if(GUILayout.Button("Update Configuration!"))
|
||||
{
|
||||
myTarget.UpdateConfiguration(myTarget.configuration.version);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GUILayout.BeginVertical("", boxStyleModified);
|
||||
|
||||
if(!Application.isPlaying)
|
||||
EditorGUILayout.PropertyField(configuration);
|
||||
if(GUILayout.Button("Save all Modules"))
|
||||
{
|
||||
myTarget.SaveAllModules();
|
||||
}
|
||||
if(GUILayout.Button("Load all Modules"))
|
||||
{
|
||||
myTarget.LoadAllModules();
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
|
||||
GUILayout.BeginVertical("", wrapStyle);
|
||||
GUILayout.BeginHorizontal("", headerStyle);
|
||||
|
||||
EditorGUI.BeginDisabledGroup(myTarget.Time != null);
|
||||
if(GUILayout.Button("Time"))
|
||||
{
|
||||
if (myTarget.Time == null)
|
||||
myTarget.AddModule(EnviroManager.ModuleType.Time);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
EditorGUI.BeginDisabledGroup(myTarget.Sky != null);
|
||||
if(GUILayout.Button("Sky"))
|
||||
{
|
||||
if (myTarget.Sky == null)
|
||||
myTarget.AddModule(EnviroManager.ModuleType.Sky);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
EditorGUI.BeginDisabledGroup(myTarget.Lighting != null);
|
||||
if(GUILayout.Button("Lighting"))
|
||||
{
|
||||
if (myTarget.Lighting == null)
|
||||
myTarget.AddModule(EnviroManager.ModuleType.Lighting);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
EditorGUI.BeginDisabledGroup(myTarget.Reflections != null);
|
||||
if(GUILayout.Button("Reflections"))
|
||||
{
|
||||
if (myTarget.Reflections == null)
|
||||
myTarget.AddModule(EnviroManager.ModuleType.Reflections);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
EditorGUI.BeginDisabledGroup(myTarget.Fog != null);
|
||||
if(GUILayout.Button("Fog"))
|
||||
{
|
||||
if (myTarget.Fog == null)
|
||||
myTarget.AddModule(EnviroManager.ModuleType.Fog);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
EditorGUI.BeginDisabledGroup(myTarget.VolumetricClouds != null);
|
||||
if(GUILayout.Button("Volumetric Clouds"))
|
||||
{
|
||||
if (myTarget.VolumetricClouds == null)
|
||||
myTarget.AddModule(EnviroManager.ModuleType.VolumetricClouds);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
EditorGUI.BeginDisabledGroup(myTarget.FlatClouds != null);
|
||||
if(GUILayout.Button("Flat Clouds"))
|
||||
{
|
||||
if (myTarget.FlatClouds == null)
|
||||
myTarget.AddModule(EnviroManager.ModuleType.FlatClouds);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
EditorGUI.BeginDisabledGroup(myTarget.Aurora != null);
|
||||
if(GUILayout.Button("Aurora"))
|
||||
{
|
||||
if (myTarget.Aurora == null)
|
||||
myTarget.AddModule(EnviroManager.ModuleType.Aurora);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
//////////////////////////////////////
|
||||
|
||||
GUILayout.BeginHorizontal("", headerStyle);
|
||||
|
||||
|
||||
EditorGUI.BeginDisabledGroup(myTarget.Environment != null);
|
||||
if(GUILayout.Button("Environment"))
|
||||
{
|
||||
if (myTarget.Environment == null)
|
||||
myTarget.AddModule(EnviroManager.ModuleType.Environment);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
EditorGUI.BeginDisabledGroup(myTarget.Lightning != null);
|
||||
if(GUILayout.Button("Lightning"))
|
||||
{
|
||||
if (myTarget.Lightning == null)
|
||||
myTarget.AddModule(EnviroManager.ModuleType.Lightning);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
|
||||
EditorGUI.BeginDisabledGroup(myTarget.Weather != null);
|
||||
if(GUILayout.Button("Weather"))
|
||||
{
|
||||
if (myTarget.Weather == null)
|
||||
myTarget.AddModule(EnviroManager.ModuleType.Weather);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
|
||||
EditorGUI.BeginDisabledGroup(myTarget.Audio != null);
|
||||
if(GUILayout.Button("Audio"))
|
||||
{
|
||||
if (myTarget.Audio == null)
|
||||
myTarget.AddModule(EnviroManager.ModuleType.Audio);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
EditorGUI.BeginDisabledGroup(myTarget.Effects != null);
|
||||
if(GUILayout.Button("Effects"))
|
||||
{
|
||||
if (myTarget.Effects == null)
|
||||
myTarget.AddModule(EnviroManager.ModuleType.Effects);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
EditorGUI.BeginDisabledGroup(myTarget.Quality != null);
|
||||
if(GUILayout.Button("Quality"))
|
||||
{
|
||||
if (myTarget.Quality == null)
|
||||
myTarget.AddModule(EnviroManager.ModuleType.Quality);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.EndVertical();
|
||||
|
||||
|
||||
/////////Modules Start
|
||||
GUILayout.Space(10);
|
||||
if(myTarget.Time != null)
|
||||
{
|
||||
if(currentTimeModuleEditor == null)
|
||||
currentTimeModuleEditor = Editor.CreateEditor(myTarget.Time);
|
||||
currentTimeModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
GUI.backgroundColor = baseModuleColor;
|
||||
GUILayout.BeginVertical("",boxStyleModified);
|
||||
GUI.backgroundColor = Color.white;
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
myTarget.showNonTimeControls = GUILayout.Toggle(myTarget.showNonTimeControls, "Sun and Moon Controls", headerFoldout);
|
||||
EditorGUILayout.EndHorizontal();
|
||||
if(myTarget.showNonTimeControls)
|
||||
{
|
||||
EditorGUILayout.LabelField("This module will control your sun and moon position when no time module is used.");
|
||||
//serializedObj.UpdateIfRequiredOrScript ();
|
||||
//EditorGUI.BeginChangeCheck();
|
||||
GUI.backgroundColor = categoryModuleColor;
|
||||
GUILayout.BeginVertical("",boxStyleModified);
|
||||
GUI.backgroundColor = Color.white;
|
||||
|
||||
EditorGUILayout.PropertyField(sunRotationX);
|
||||
EditorGUILayout.PropertyField(sunRotationY);
|
||||
EditorGUILayout.PropertyField(moonRotationX);
|
||||
EditorGUILayout.PropertyField(moonRotationY);
|
||||
GUILayout.Space(5);
|
||||
EditorGUILayout.PropertyField(dayNightSwitch);
|
||||
GUILayout.EndVertical();
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
|
||||
if(myTarget.showNonTimeControls)
|
||||
GUILayout.Space(10);
|
||||
}
|
||||
|
||||
if(myTarget.Lighting != null)
|
||||
{
|
||||
if(currentLightingModuleEditor == null)
|
||||
currentLightingModuleEditor = Editor.CreateEditor(myTarget.Lighting);
|
||||
|
||||
currentLightingModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(myTarget.Reflections != null)
|
||||
{
|
||||
if(currentReflectionsModuleEditor == null)
|
||||
currentReflectionsModuleEditor = Editor.CreateEditor(myTarget.Reflections);
|
||||
|
||||
currentReflectionsModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(myTarget.Sky != null)
|
||||
{
|
||||
if(currentSkyModuleEditor == null)
|
||||
currentSkyModuleEditor = Editor.CreateEditor(myTarget.Sky);
|
||||
|
||||
currentSkyModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(myTarget.Fog != null)
|
||||
{
|
||||
if(currentFogModuleEditor == null)
|
||||
currentFogModuleEditor = Editor.CreateEditor(myTarget.Fog);
|
||||
|
||||
currentFogModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(myTarget.VolumetricClouds != null)
|
||||
{
|
||||
if(currentVolumetricCloudModuleEditor == null)
|
||||
currentVolumetricCloudModuleEditor = Editor.CreateEditor(myTarget.VolumetricClouds);
|
||||
|
||||
currentVolumetricCloudModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(myTarget.FlatClouds != null)
|
||||
{
|
||||
if(currentFlatCloudModuleEditor == null)
|
||||
currentFlatCloudModuleEditor = Editor.CreateEditor(myTarget.FlatClouds);
|
||||
|
||||
currentFlatCloudModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(myTarget.Aurora != null)
|
||||
{
|
||||
if(currentAuroraModuleEditor == null)
|
||||
currentAuroraModuleEditor = Editor.CreateEditor(myTarget.Aurora);
|
||||
|
||||
currentAuroraModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(myTarget.Lightning != null)
|
||||
{
|
||||
if(currentLightningModuleEditor == null)
|
||||
currentLightningModuleEditor = Editor.CreateEditor(myTarget.Lightning);
|
||||
|
||||
currentLightningModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(myTarget.Environment != null)
|
||||
{
|
||||
if(currentEnvironmentModuleEditor == null)
|
||||
currentEnvironmentModuleEditor = Editor.CreateEditor(myTarget.Environment);
|
||||
|
||||
currentEnvironmentModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(myTarget.Weather != null)
|
||||
{
|
||||
if(currentWeatherModuleEditor == null)
|
||||
currentWeatherModuleEditor = Editor.CreateEditor(myTarget.Weather);
|
||||
|
||||
currentWeatherModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(myTarget.Audio != null)
|
||||
{
|
||||
if(currentAudioModuleEditor == null)
|
||||
currentAudioModuleEditor = Editor.CreateEditor(myTarget.Audio);
|
||||
|
||||
currentAudioModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(myTarget.Effects != null)
|
||||
{
|
||||
if(currentEffectsModuleEditor == null)
|
||||
currentEffectsModuleEditor = Editor.CreateEditor(myTarget.Effects);
|
||||
|
||||
currentEffectsModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
|
||||
if(myTarget.Quality != null)
|
||||
{
|
||||
if(currentQualityModuleEditor == null)
|
||||
currentQualityModuleEditor = Editor.CreateEditor(myTarget.Quality);
|
||||
|
||||
currentQualityModuleEditor.OnInspectorGUI();
|
||||
}
|
||||
}
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
|
||||
//Modules End
|
||||
|
||||
GUILayout.BeginVertical("",boxStyle);
|
||||
myTarget.showEvents = GUILayout.Toggle(myTarget.showEvents, "Events", headerFoldout);
|
||||
|
||||
if(myTarget.showEvents)
|
||||
{
|
||||
GUI.backgroundColor = thirdPartyModuleColor;
|
||||
GUILayout.BeginVertical("", boxStyleModified);
|
||||
GUI.backgroundColor = Color.white;
|
||||
GUILayout.Space(5);
|
||||
EditorGUILayout.PropertyField(onHourPassedActions);
|
||||
EditorGUILayout.PropertyField(onDayPassedActions);
|
||||
EditorGUILayout.PropertyField(onYearPassedActions);
|
||||
GUILayout.Space(5);
|
||||
EditorGUILayout.PropertyField(onWeatherChangedActions);
|
||||
EditorGUILayout.PropertyField(onSeasonChangedActions);
|
||||
GUILayout.Space(5);
|
||||
EditorGUILayout.PropertyField(onDayActions);
|
||||
EditorGUILayout.PropertyField(onNightActions);
|
||||
GUILayout.EndVertical();
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
|
||||
GUILayout.BeginVertical("",boxStyle);
|
||||
myTarget.showThirdParty = GUILayout.Toggle(myTarget.showThirdParty, "Third Party Support", headerFoldout);
|
||||
|
||||
if(myTarget.showThirdParty)
|
||||
{
|
||||
GUILayout.Space(5);
|
||||
|
||||
//WAPI
|
||||
GUI.backgroundColor = thirdPartyModuleColor;
|
||||
GUILayout.BeginVertical("World Manager API", boxStyleModified);
|
||||
GUI.backgroundColor = Color.white;
|
||||
GUILayout.Space(20);
|
||||
#if WORLDAPI_PRESENT
|
||||
|
||||
//GUILayout.Label("World Manager API detected!", headerStyle);
|
||||
//GUILayout.Space(5);
|
||||
RenderIntegrationTextBox("You can add support for WAPI from the ('Components' -> 'Enviro 3' -> 'Integrations' -> 'WAPI') menu.");
|
||||
#else
|
||||
GUILayout.Label("World Manager API no found!", headerStyle);
|
||||
#endif
|
||||
GUILayout.EndVertical();
|
||||
|
||||
//MicroSplat
|
||||
GUI.backgroundColor = thirdPartyModuleColor;
|
||||
GUILayout.BeginVertical("MicroSplat", boxStyleModified);
|
||||
GUI.backgroundColor = Color.white;
|
||||
GUILayout.Space(20);
|
||||
RenderIntegrationTextBox("You can add support for MicroSplat and Better Lit Shaders from the ('Components' -> 'Enviro 3' -> 'Integrations' -> 'Microsplat') menu.");
|
||||
GUILayout.EndVertical();
|
||||
//////////
|
||||
|
||||
//Mirror
|
||||
GUI.backgroundColor = thirdPartyModuleColor;
|
||||
GUILayout.BeginVertical("Mirror Networking", boxStyleModified);
|
||||
GUI.backgroundColor = Color.white;
|
||||
GUILayout.Space(20);
|
||||
#if ENVIRO_MIRROR_SUPPORT
|
||||
//GUILayout.Label("Mirror Networking support activated.", headerStyle);
|
||||
//GUILayout.Space(5);
|
||||
RenderIntegrationTextBox("Please add the 'Mirror Server' component to a new GameObject in your scene. ('Components' -> 'Enviro 3' -> 'Integrations' -> 'Mirror Server')");
|
||||
RenderIntegrationTextBox("Please add the 'Mirror Player' component to your player prefab. ('Components' -> 'Enviro 3' -> 'Integrations' -> 'Mirror Player')");
|
||||
GUILayout.Space(10);
|
||||
if (GUILayout.Button("Deactivate Mirror Support"))
|
||||
{
|
||||
RemoveDefineSymbol("ENVIRO_MIRROR_SUPPORT");
|
||||
}
|
||||
#else
|
||||
if (GUILayout.Button("Activate Mirror Support"))
|
||||
{
|
||||
AddDefineSymbol("ENVIRO_MIRROR_SUPPORT");
|
||||
}
|
||||
if (GUILayout.Button("Deactivate Mirror Support"))
|
||||
{
|
||||
RemoveDefineSymbol("ENVIRO_MIRROR_SUPPORT");
|
||||
}
|
||||
#endif
|
||||
GUILayout.EndVertical();
|
||||
//////////
|
||||
|
||||
//Photon
|
||||
GUI.backgroundColor = thirdPartyModuleColor;
|
||||
GUILayout.BeginVertical("Photon PUN Networking", boxStyleModified);
|
||||
GUI.backgroundColor = Color.white;
|
||||
GUILayout.Space(20);
|
||||
#if ENVIRO_PHOTON_SUPPORT
|
||||
RenderIntegrationTextBox("Please add the 'Photon Integration' component to a new GameObject in your scene. ('Components' -> 'Enviro 3' -> 'Integrations' -> 'Photon Integration')");
|
||||
GUILayout.Space(10);
|
||||
if (GUILayout.Button("Deactivate Photon Support"))
|
||||
{
|
||||
RemoveDefineSymbol("ENVIRO_PHOTON_SUPPORT");
|
||||
}
|
||||
#else
|
||||
if (GUILayout.Button("Activate Photon Support"))
|
||||
{
|
||||
AddDefineSymbol("ENVIRO_PHOTON_SUPPORT");
|
||||
}
|
||||
if (GUILayout.Button("Deactivate Photon Support"))
|
||||
{
|
||||
RemoveDefineSymbol("ENVIRO_PHOTON_SUPPORT");
|
||||
}
|
||||
#endif
|
||||
GUILayout.EndVertical();
|
||||
//////////
|
||||
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
ApplyChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62d831ecb648e7b48a72bbfd06e4e0df
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 236601
|
||||
packageName: Enviro 3 - Sky and Weather
|
||||
packageVersion: 3.1.2
|
||||
assetPath: Assets/Enviro 3 - Sky and Weather/Scripts/Editor/Base/EnviroManagerInspector.cs
|
||||
uploadId: 660896
|
||||
@@ -0,0 +1,63 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Enviro
|
||||
{
|
||||
|
||||
[CustomEditor(typeof(EnviroModule))]
|
||||
public class EnviroModuleEditor : EnviroBaseInspector
|
||||
{
|
||||
public SerializedProperty preset;
|
||||
|
||||
public virtual void OnEnable()
|
||||
{
|
||||
//SetupGUIStyles ();
|
||||
}
|
||||
|
||||
public void SetActiveGUIColor(bool active)
|
||||
{
|
||||
if(active)
|
||||
GUI.backgroundColor = new Color(1f,1f,2f,1f);
|
||||
}
|
||||
|
||||
public void UnsetActiveGUIColor()
|
||||
{
|
||||
GUI.backgroundColor = Color.white;
|
||||
}
|
||||
|
||||
public void DisableInputStart()
|
||||
{
|
||||
if(EnviroManager.instance != null && EnviroManager.instance.Weather != null)
|
||||
{
|
||||
if(EnviroManager.instance.Weather.targetWeatherType != null)
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void DisableInputEnd()
|
||||
{
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
|
||||
public void DisableInputStartQuality()
|
||||
{
|
||||
if(EnviroManager.instance != null && EnviroManager.instance.Quality != null)
|
||||
{
|
||||
if(EnviroManager.instance.Quality.Settings.defaultQuality != null)
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void DisableInputEndQuality()
|
||||
{
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
SetupGUIStyles ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 35f984cbe14c3484188df7a318f6c5e2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 236601
|
||||
packageName: Enviro 3 - Sky and Weather
|
||||
packageVersion: 3.1.2
|
||||
assetPath: Assets/Enviro 3 - Sky and Weather/Scripts/Editor/Base/EnviroModuleEditor.cs
|
||||
uploadId: 660896
|
||||
@@ -0,0 +1,91 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor.Build;
|
||||
using UnityEditor.Rendering;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
namespace Enviro
|
||||
{
|
||||
public class ShaderStripper : IPreprocessShaders
|
||||
{
|
||||
private const string LOG_FILE_PATH = "Library/Shader Compilation Results.txt";
|
||||
|
||||
private static readonly ShaderKeyword[] SKIPPED_VARIANTS = new ShaderKeyword[]
|
||||
{
|
||||
new ShaderKeyword( "ENVIROHDRP" ),
|
||||
new ShaderKeyword( "ENVIROURP" ),
|
||||
};
|
||||
|
||||
public int callbackOrder { get { return 0; } }
|
||||
|
||||
public void OnProcessShader( Shader shader, ShaderSnippetData snippet, IList<ShaderCompilerData> data )
|
||||
{
|
||||
string shaderName = shader.name;
|
||||
|
||||
//URP Shader
|
||||
#if !ENVIRO_URP
|
||||
if(shaderName == "Hidden/EnviroBlitThrough")
|
||||
data.Clear();
|
||||
|
||||
if(shaderName == "Hidden/VolumetricsURP")
|
||||
data.Clear();
|
||||
#endif
|
||||
|
||||
//URP 17+ Shader
|
||||
#if !ENVIRO_URP || !UNITY_6000_0_OR_NEWER
|
||||
if(shaderName == "Hidden/EnviroBlitThroughURP17")
|
||||
data.Clear();
|
||||
|
||||
if(shaderName == "Hidden/EnviroBlurURP")
|
||||
data.Clear();
|
||||
|
||||
if(shaderName == "Hidden/EnviroHeightFogURP")
|
||||
data.Clear();
|
||||
|
||||
if(shaderName == "Hidden/EnviroApplyShadowsURP")
|
||||
data.Clear();
|
||||
|
||||
if(shaderName == "Hidden/EnviroVolumetricCloudsBlendURP")
|
||||
data.Clear();
|
||||
|
||||
if(shaderName == "Hidden/EnviroVolumetricCloudsDepthURP")
|
||||
data.Clear();
|
||||
|
||||
if(shaderName == "Hidden/EnviroCloudsRaymarchURP")
|
||||
data.Clear();
|
||||
|
||||
if(shaderName == "Hidden/EnviroVolumetricCloudsReprojectURP")
|
||||
data.Clear();
|
||||
|
||||
#endif
|
||||
|
||||
//HDRP Shaders
|
||||
#if !ENVIRO_HDRP
|
||||
if(shaderName == "Hidden/Enviro/BlitTroughHDRP")
|
||||
data.Clear();
|
||||
|
||||
if(shaderName == "Hidden/EnviroApplyShadowsHDRP")
|
||||
data.Clear();
|
||||
|
||||
if(shaderName == "Hidden/EnviroCloudsRaymarchHDRP")
|
||||
data.Clear();
|
||||
|
||||
if(shaderName == "Hidden/EnviroVolumetricCloudsBlendHDRP")
|
||||
data.Clear();
|
||||
|
||||
if(shaderName == "Hidden/EnviroVolumetricCloudsDepthHDRP")
|
||||
data.Clear();
|
||||
|
||||
if(shaderName == "Hidden/EnviroVolumetricCloudsReprojectHDRP")
|
||||
data.Clear();
|
||||
|
||||
if(shaderName == "Hidden/EnviroHeightFogHDRP")
|
||||
data.Clear();
|
||||
|
||||
if(shaderName == "Enviro/HDRP/Sky")
|
||||
data.Clear();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 53a2b3d33a037bc4d9b491ff07a1219f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 236601
|
||||
packageName: Enviro 3 - Sky and Weather
|
||||
packageVersion: 3.1.2
|
||||
assetPath: Assets/Enviro 3 - Sky and Weather/Scripts/Editor/Base/EnviroShaderStripper.cs
|
||||
uploadId: 660896
|
||||
Reference in New Issue
Block a user