Aetheria/Assets/Scripts/Editor/CellBrushEditor.cs
Reinier Vens 69aca09f63 Boundless
Removed hard zone boundaries
Fixed stuff that broke because of hard zone boundary assumption (stardust placement, vertical fog)
Added a skybox!
Removed density-based albedo boost (_TintExponent) to improve perceptual uniformity at different step sizes, reconfigured shader to achieve / surpass previous looks and performance
Cell Brush has a material editor now to enable variant selection
Enabled Caching Shader Preprocessor
Moved raymarching loop into CloudShader
Get environment settings from game manager to enable configuration / variation
Introduced slope-based nebulae damping and volumetric flow
Hid optional volumetric features behind preprocessor branches
Created shader variants selected by global keywords for all shaders depending on volumetrics
Environment settings used to configure shader variant selection
Moved dynamic lighting settings to own subclass
Dynamically adjust gravity map isoline contour depth range according to zone contents
2022-07-21 21:40:44 +01:00

35 lines
No EOL
937 B
C#

using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Linq;
public class CellBrushEditor : MaterialEditor
{
private static readonly string[] Keywords = new[] {"A", "B", "C", "D", "E", "F", "G", "H"};
public override void OnInspectorGUI ()
{
// Draw the default inspector.
base.OnInspectorGUI ();
// If we are not visible, return.
if (!isVisible)
return;
// Get the current keywords from the material
Material targetMat = target as Material;
string[] keyWords = targetMat.shaderKeywords;
int selected = keyWords.Any()?Array.IndexOf(Keywords,keyWords.First()):0;
EditorGUI.BeginChangeCheck();
selected = EditorGUILayout.Popup("Variant", selected, Keywords);
// If something has changed, update the material.
if (EditorGUI.EndChangeCheck())
{
targetMat.shaderKeywords = new []{Keywords[selected]};
EditorUtility.SetDirty (targetMat);
}
}
}