Initial commit

This commit is contained in:
gunnbr committed 2021-01-11 22:20:43 -08:00
1 parent ee9615239e
commit 16feac691f
4093 files changed
+1030491

No files matched your search

@@ -0,0 +1,21 @@
using UnityEditor;
namespace Gaia
{
[CustomEditor(typeof(GaiaPlanarReflections))]
public class GaiaPlanarReflectionsEditor : Editor
{
private const string m_helpText = "Gaia Planar Reflections is the reflection system for SRP this system only work in URP/HDRP. This system uses the SRP camera commands to render reflections in realtime. This system also supports shadows, custom render distances and unity layers.";
private GaiaPlanarReflections m_reflections;
public override void OnInspectorGUI()
{
if (m_reflections == null)
{
m_reflections = (GaiaPlanarReflections) target;
}
//Initialization
EditorGUILayout.HelpBox(m_helpText, MessageType.Info);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: bb560212dad63024b9985a1d559addcd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,102 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
using PWCommon4;
using Gaia.Internal;
using Gaia;
namespace ProceduralWorlds.WaterSystem
{
/// <summary>
/// Editor for the PWS_WaterReflections
/// </summary>
[CustomEditor(typeof(PWS_WaterSystem))]
public class PWS_WaterReflectionsEditor : PWEditor
{
private EditorUtils m_editorUtils;
private PWS_WaterSystem WaterReflections;
private void OnEnable()
{
WaterReflections = (PWS_WaterSystem)target;
if (m_editorUtils == null)
{
// Get editor utils for this
m_editorUtils = PWApp.GetEditorUtils(this);
}
}
#region Inspector Region
/// <summary>
/// Custom editor for PWS_WaterReflections
/// </summary
public override void OnInspectorGUI()
{
EditorGUI.BeginChangeCheck();
//Initialization
m_editorUtils.Initialize(); // Do not remove this!
if (WaterReflections == null)
{
WaterReflections = (PWS_WaterSystem)target;
}
m_editorUtils.Panel("GlobalSettings", GlobalSettings, true);
if (EditorGUI.EndChangeCheck())
{
EditorUtility.SetDirty(WaterReflections);
}
}
#endregion
#region Panel
/// <summary>
/// Global Main Panel
/// </summary>
/// <param name="helpEnabled"></param>
private void GlobalSettings(bool helpEnabled)
{
m_editorUtils.Heading("Setup");
EditorGUI.indentLevel++;
WaterReflections.SunLight = (Light)m_editorUtils.ObjectField("SunLight", WaterReflections.SunLight, typeof(Light), true, helpEnabled);
WaterReflections.m_player = (Transform)m_editorUtils.ObjectField("Player", WaterReflections.m_player, typeof(Transform), true, helpEnabled);
WaterReflections.SeaLevel = m_editorUtils.FloatField("SeaLevel", WaterReflections.SeaLevel, helpEnabled);
WaterReflections.InfiniteMode = m_editorUtils.Toggle("InfiniteMode", WaterReflections.InfiniteMode, helpEnabled);
EditorGUI.indentLevel--;
/*m_editorUtils.Heading("SurfaceSettings");
EditorGUI.indentLevel++;
WaterReflections.m_minSurfaceLight = m_editorUtils.FloatField("MinSurfaceLight", WaterReflections.m_minSurfaceLight, helpEnabled);
if (WaterReflections.m_minSurfaceLight > WaterReflections.m_maxSurfaceLight)
{
WaterReflections.m_minSurfaceLight = WaterReflections.m_maxSurfaceLight - 0.1f;
}
if (WaterReflections.m_minSurfaceLight < 0f)
{
WaterReflections.m_minSurfaceLight = 0f;
}
WaterReflections.m_maxSurfaceLight = m_editorUtils.FloatField("MaxSurfaceLight", WaterReflections.m_maxSurfaceLight, helpEnabled);
if (WaterReflections.m_maxSurfaceLight < 0.1f)
{
WaterReflections.m_maxSurfaceLight = 0.1f;
}
EditorGUI.indentLevel--;*/
if (m_editorUtils.Button("EditReflectionSettings"))
{
GaiaUtils.FocusWaterProfile();
}
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8b83c234d2445d946be3b2aaa34e0ae2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,85 @@
using System.Collections;
using System.Collections.Generic;
using Gaia.Internal;
using PWCommon4;
using UnityEditor;
using UnityEngine;
namespace Gaia
{
[CustomEditor(typeof(ReflectionMasker))]
public class ReflectionMaskerEditor : PWEditor
{
private EditorUtils m_editorUtils;
private ReflectionMasker m_profile;
private Color GUIBackground;
private void OnEnable()
{
if (m_editorUtils == null)
{
// Get editor utils for this
m_editorUtils = PWApp.GetEditorUtils(this);
}
}
/// <summary>
/// Setup on destroy
/// </summary>
private void OnDestroy()
{
if (m_editorUtils != null)
{
m_editorUtils.Dispose();
}
}
public override void OnInspectorGUI()
{
//Initialization
m_editorUtils.Initialize(); // Do not remove this!
if (m_profile == null)
{
m_profile = (ReflectionMasker) target;
}
m_editorUtils.Panel("GlobalSettings", GlobalSettings, true);
}
private void GlobalSettings(bool helpEnabled)
{
EditorGUI.BeginChangeCheck();
GUIBackground = GUI.backgroundColor;
m_profile.Player = (Transform)m_editorUtils.ObjectField("Player", m_profile.Player, typeof(Transform), true, helpEnabled, GUILayout.MaxHeight(16f));
if (m_profile.Player == null)
{
m_profile.Player = m_profile.GetPlayer();
}
if (m_profile.ReflectionMaskerData.m_maskingTexture == null)
{
EditorGUILayout.HelpBox("The mask texture is null. This system needs a mask texture to function please provide one.", MessageType.Error);
GUI.backgroundColor = Color.red;
}
else
{
if (!m_profile.ReflectionMaskerData.m_maskingTexture.isReadable)
{
EditorGUILayout.HelpBox("The mask texture " + m_profile.ReflectionMaskerData.m_maskingTexture.name + " is not Read/Write enabled please go to the texture import settings and enable this setting then click apply.", MessageType.Error);
GUI.backgroundColor = Color.red;
}
}
m_profile.ReflectionMaskerData.m_maskingTexture = (Texture2D)m_editorUtils.ObjectField("MaskTexture", m_profile.ReflectionMaskerData.m_maskingTexture, typeof(Texture2D), false, helpEnabled, GUILayout.MaxHeight(16f));
GUI.backgroundColor = GUIBackground;
EditorGUI.indentLevel++;
m_profile.ReflectionMaskerData.m_channelSelection = (ReflectionMaskerChannelSelection)m_editorUtils.EnumPopup("ChannelSelection", m_profile.ReflectionMaskerData.m_channelSelection, helpEnabled);
m_profile.ReflectionMaskerData.m_minValue = m_editorUtils.Slider("MinValue",m_profile.ReflectionMaskerData.m_minValue, 0f, m_profile.ReflectionMaskerData.m_maxValue - 0.01f, helpEnabled);
m_profile.ReflectionMaskerData.m_maxValue = m_editorUtils.Slider("MaxValue",m_profile.ReflectionMaskerData.m_maxValue, m_profile.ReflectionMaskerData.m_minValue + 0.01f, 1f, helpEnabled);
EditorGUI.indentLevel--;
if (EditorGUI.EndChangeCheck())
{
EditorUtility.SetDirty(m_profile);
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 77b936a1f8700f5418980af13502f681
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: