private void UsageRange(SGT_ShaderUsage u, out int min, out int max) { min = 0; max = 0; switch (u) { case SGT_ShaderUsage.NeverEnabled: min = 0; max = 0; break; case SGT_ShaderUsage.SometimesEnabled: min = 0; max = 1; break; case SGT_ShaderUsage.AlwaysEnabled: min = 1; max = 1; break; } }
public override void OnInspector() { SGT_EditorGUI.Separator(); if (SGT_EditorGUI.Button("Include All Shaders") == true) { MoveShaders(false); } if (SGT_EditorGUI.Button("Sync Shaders") == true) { MoveShaders(true); } SGT_EditorGUI.Separator(); buildAsteroidRing = SGT_EditorGUI.BeginToggleGroup("Asteroid Ring", null, buildAsteroidRing); { buildAsteroidRingShadow = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Shadow", null, buildAsteroidRingShadow); buildAsteroidRingSpin = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Spin", null, buildAsteroidRingSpin); } SGT_EditorGUI.EndToggleGroup(); SGT_EditorGUI.Separator(); buildCorona = SGT_EditorGUI.BeginToggleGroup("Corona", null, buildCorona); { buildCoronaCullNear = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Cull Near", null, buildCoronaCullNear); buildCoronaPerPixel = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Per Pixel", null, buildCoronaPerPixel); buildCoronaRing = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Ring", null, buildCoronaRing); } SGT_EditorGUI.EndToggleGroup(); SGT_EditorGUI.Separator(); buildFog = SGT_EditorGUI.BeginToggleGroup("Fog (Volumetric Probe)", null, buildFog); { } SGT_EditorGUI.EndToggleGroup(); SGT_EditorGUI.Separator(); buildGasGiant = SGT_EditorGUI.BeginToggleGroup("Gas Giant", null, buildGasGiant); { buildGasGiantPlanetShadow = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Planet Shadow", null, buildGasGiantPlanetShadow); buildGasGiantRingShadow = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Ring Shadow", null, buildGasGiantRingShadow); } SGT_EditorGUI.EndToggleGroup(); SGT_EditorGUI.Separator(); buildPlanet = SGT_EditorGUI.BeginToggleGroup("Planet", null, buildPlanet); { buildPlanetAtmosphere = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Atmosphere", null, buildPlanetAtmosphere); SGT_EditorGUI.BeginIndent(buildPlanetAtmosphere != SGT_ShaderUsage.NeverEnabled); { buildPlanetScattering = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Scattering", null, buildPlanetScattering); } SGT_EditorGUI.EndIndent(); buildPlanetNormal = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Normal", null, buildPlanetNormal); buildPlanetSpecular = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Specular", null, buildPlanetSpecular); buildPlanetPlanetShadow = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Planet Shadow", null, buildPlanetPlanetShadow); buildPlanetRingShadow = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Ring Shadow", null, buildPlanetRingShadow); buildPlanetDetail = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Detail", null, buildPlanetDetail); buildPlanetClouds = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Clouds", null, buildPlanetClouds); } SGT_EditorGUI.EndToggleGroup(); SGT_EditorGUI.Separator(); buildRing = SGT_EditorGUI.BeginToggleGroup("Ring", null, buildRing); { buildRingStretched = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Stretched", null, buildRingStretched); buildRingShadow = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Shadow", null, buildRingShadow); buildRingLit = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Lit", null, buildRingLit); buildRingScattering = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Scattering", null, buildRingScattering); } SGT_EditorGUI.EndToggleGroup(); SGT_EditorGUI.Separator(); buildSkysphere = SGT_EditorGUI.BeginToggleGroup("Skysphere", null, buildSkysphere); { } SGT_EditorGUI.EndToggleGroup(); SGT_EditorGUI.Separator(); buildStar = SGT_EditorGUI.BeginToggleGroup("Star", null, buildStar); { buildStarPerPixel = (SGT_ShaderUsage)SGT_EditorGUI.EnumField("Per Pixel", null, buildStarPerPixel); } SGT_EditorGUI.EndToggleGroup(); SGT_EditorGUI.Separator(); buildStarfield = SGT_EditorGUI.BeginToggleGroup("Starfield", null, buildStarfield); { } SGT_EditorGUI.EndToggleGroup(); SGT_EditorGUI.Separator(); buildDust = SGT_EditorGUI.BeginToggleGroup("Dust", null, buildDust); { } SGT_EditorGUI.EndToggleGroup(); SGT_EditorGUI.Separator(); buildNebula = SGT_EditorGUI.BeginToggleGroup("Nebula", null, buildNebula); { } SGT_EditorGUI.EndToggleGroup(); SGT_EditorGUI.Separator(); }