Skip to content

Commit

Permalink
Add material labels, grouping and texture names
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeTwentyThree committed Dec 19, 2024
1 parent 981b7f7 commit 52f84ab
Show file tree
Hide file tree
Showing 4 changed files with 249 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,43 +25,59 @@ public static class MaterialEditorPropertyTypes
{ MaterialEditorProperties.Cutoff, new PropertyTypeFloat("_Cutoff", 0f, 1f) },
{ MaterialEditorProperties.EnableDitherAlpha, new PropertyTypeFloat("_EnableDitherAlpha", true) },
{ MaterialEditorProperties.EnableVrFadeOut, new PropertyTypeFloat("_EnableVrFadeOut", true) },
{ MaterialEditorProperties.VrFadeMask, new PropertyTypeTexture("_VrFadeMask") },
{ MaterialEditorProperties.EnableLighting, new PropertyTypeFloat("_EnableLighting", true) },
{ MaterialEditorProperties.IBLreductionAtNight, new PropertyTypeFloat("_IBLreductionAtNight", 0f, 1f) },
{ MaterialEditorProperties.EnableSimpleGlass, new PropertyTypeFloat("_EnableSimpleGlass", true) },
{ MaterialEditorProperties.EnableVertexColor, new PropertyTypeFloat("_EnableVertexColor", true) },
{ MaterialEditorProperties.EnableSchoolFish, new PropertyTypeFloat("_EnableSchoolFish", true) },
{ MaterialEditorProperties.EnableMainMaps, new PropertyTypeFloat("_EnableMainMaps", true) },
{ MaterialEditorProperties.MainTex, new PropertyTypeTexture("_MainTex") },
{ MaterialEditorProperties.BumpMap, new PropertyTypeTexture("_BumpMap") },
{ MaterialEditorProperties.MarmoSpecEnum, new PropertyTypeFloat("_MarmoSpecEnum", 0.0f, 100f) },
{ MaterialEditorProperties.SIGMap, new PropertyTypeTexture("_SIGMap") },
{ MaterialEditorProperties.SpecTex, new PropertyTypeTexture("_SpecTex") },
{ MaterialEditorProperties.SpecColor, new PropertyTypeColor("_SpecColor", true) },
{ MaterialEditorProperties.SpecInt, new PropertyTypeFloat("_SpecInt", 0.0f, 100f) },
{ MaterialEditorProperties.Shininess, new PropertyTypeFloat("_Shininess", 2f, 8f) },
{ MaterialEditorProperties.Fresnel, new PropertyTypeFloat("_Fresnel", 0f, 1f) },
{ MaterialEditorProperties.EnableGlow, new PropertyTypeFloat("_EnableGlow", true) },
{ MaterialEditorProperties.GlowColor, new PropertyTypeColor("_GlowColor", true) },
{ MaterialEditorProperties.Illum, new PropertyTypeTexture("_Illum") },
{ MaterialEditorProperties.GlowUVfromVC, new PropertyTypeFloat("_GlowUVfromVC", 0.0f, 100f) },
{ MaterialEditorProperties.GlowStrength, new PropertyTypeFloat("_GlowStrength", 0.0f, 100f) },
{ MaterialEditorProperties.GlowStrengthNight, new PropertyTypeFloat("_GlowStrengthNight", 0.0f, 100f) },
{ MaterialEditorProperties.EmissionLM, new PropertyTypeFloat("_EmissionLM", 0.0f, 100f) },
{ MaterialEditorProperties.EmissionLMNight, new PropertyTypeFloat("_EmissionLMNight", 0.0f, 100f) },
{ MaterialEditorProperties.EnableDetailMaps, new PropertyTypeFloat("_EnableDetailMaps", true) },
{ MaterialEditorProperties.DetailDiffuseTex, new PropertyTypeTexture("_DetailDiffuseTex") },
{ MaterialEditorProperties.DetailBumpTex, new PropertyTypeTexture("_DetailBumpTex") },
{ MaterialEditorProperties.DetailSpecTex, new PropertyTypeTexture("_DetailSpecTex") },
{ MaterialEditorProperties.DetailIntensities, new PropertyTypeVector4("_DetailIntensities") },
{ MaterialEditorProperties.EnableLightmap, new PropertyTypeFloat("_EnableLightmap", true) },
{ MaterialEditorProperties.Lightmap, new PropertyTypeTexture("_Lightmap") },
{ MaterialEditorProperties.LightmapStrength, new PropertyTypeFloat("_LightmapStrength", 0.0f, 100f) },
{ MaterialEditorProperties.Enable3Color, new PropertyTypeFloat("_Enable3Color", true) },
{ MaterialEditorProperties.MultiColorMask, new PropertyTypeTexture("_MultiColorMask") },
{ MaterialEditorProperties.Color2, new PropertyTypeColor("_Color2", true) },
{ MaterialEditorProperties.Color3, new PropertyTypeColor("_Color3", true) },
{ MaterialEditorProperties.SpecColor2, new PropertyTypeColor("_SpecColor2", true) },
{ MaterialEditorProperties.SpecColor3, new PropertyTypeColor("_SpecColor3", true) },
{ MaterialEditorProperties.FX, new PropertyTypeFloat("FX", true) },
{ MaterialEditorProperties.DeformMap, new PropertyTypeTexture("_DeformMap") },
{ MaterialEditorProperties.DeformParams, new PropertyTypeVector4("_DeformParams") },
{ MaterialEditorProperties.FillSack, new PropertyTypeFloat("_FillSack", 0f, 1f) },
{ MaterialEditorProperties.OverlayStrength, new PropertyTypeFloat("_OverlayStrength", 0f, 1f) },
{ MaterialEditorProperties.GlowScrollColor, new PropertyTypeColor("_GlowScrollColor", true) },
{ MaterialEditorProperties.GlowScrollMask, new PropertyTypeTexture("_GlowScrollMask") },
{ MaterialEditorProperties.Hypnotize, new PropertyTypeFloat("_Hypnotize", 0f, 1f) },
{ MaterialEditorProperties.ScrollColor, new PropertyTypeColor("_ScrollColor", true) },
{ MaterialEditorProperties.ColorStrength, new PropertyTypeColor("_ColorStrength", true) },
{ MaterialEditorProperties.ScrollTex, new PropertyTypeTexture("_ScrollTex") },
{ MaterialEditorProperties.GlowMask, new PropertyTypeTexture("_GlowMask") },
{ MaterialEditorProperties.GlowMaskSpeed, new PropertyTypeVector4("_GlowMaskSpeed") },
{ MaterialEditorProperties.ScrollSpeed, new PropertyTypeVector4("_ScrollSpeed") },
{ MaterialEditorProperties.NoiseTex, new PropertyTypeTexture("_NoiseTex") },
{ MaterialEditorProperties.DetailsColor, new PropertyTypeColor("_DetailsColor", true) },
{ MaterialEditorProperties.SquaresColor, new PropertyTypeColor("_SquaresColor", true) },
{ MaterialEditorProperties.SquaresTile, new PropertyTypeFloat("_SquaresTile", 0.0f, 100f) },
Expand All @@ -74,19 +90,22 @@ public static class MaterialEditorPropertyTypes
{ MaterialEditorProperties.Built, new PropertyTypeFloat("_Built", 0.0f, 100f) },
{ MaterialEditorProperties.BuildParams, new PropertyTypeVector4("_BuildParams") },
{ MaterialEditorProperties.BuildLinear, new PropertyTypeFloat("_BuildLinear", 0.0f, 100f) },
{ MaterialEditorProperties.EmissiveTex, new PropertyTypeTexture("_EmissiveTex") },
{ MaterialEditorProperties.NoiseThickness, new PropertyTypeFloat("_NoiseThickness", 0.0f, 100f) },
{ MaterialEditorProperties.NoiseStr, new PropertyTypeFloat("_NoiseStr", 0.0f, 100f) },
{ MaterialEditorProperties.FX_Vertex, new PropertyTypeFloat("FX_Vertex", true) },
{ MaterialEditorProperties.Scale, new PropertyTypeVector4("_Scale") },
{ MaterialEditorProperties.Frequency, new PropertyTypeVector4("_Frequency") },
{ MaterialEditorProperties.Speed, new PropertyTypeVector4("_Speed") },
{ MaterialEditorProperties.AnimMask, new PropertyTypeTexture("_AnimMask") },
{ MaterialEditorProperties.ObjectUp, new PropertyTypeVector4("_ObjectUp") },
{ MaterialEditorProperties.WaveUpMin, new PropertyTypeFloat("_WaveUpMin", 0.0f, 100f) },
{ MaterialEditorProperties.Fallof, new PropertyTypeFloat("_Fallof", 0.0f, 100f) },
{ MaterialEditorProperties.RopeGravity, new PropertyTypeFloat("_RopeGravity", 0.0f, 100f) },
{ MaterialEditorProperties.minYpos, new PropertyTypeFloat("_minYpos", 0.0f, 100f) },
{ MaterialEditorProperties.maxYpos, new PropertyTypeFloat("_maxYpos", 0.0f, 100f) },
{ MaterialEditorProperties.EnableBurst, new PropertyTypeFloat("_EnableBurst", true) },
{ MaterialEditorProperties.DispTex, new PropertyTypeTexture("_DispTex") },
{ MaterialEditorProperties.Displacement, new PropertyTypeFloat("_Displacement", 0f, 5f) },
{ MaterialEditorProperties.BurstStrength, new PropertyTypeFloat("_BurstStrength", 0f, 1f) },
{ MaterialEditorProperties.Range, new PropertyTypeVector4("_Range") },
Expand All @@ -96,6 +115,7 @@ public static class MaterialEditorPropertyTypes
{ MaterialEditorProperties.InfectionHeightStrength, new PropertyTypeFloat("_InfectionHeightStrength", 0.0f, 100f) },
{ MaterialEditorProperties.InfectionScale, new PropertyTypeVector4("_InfectionScale") },
{ MaterialEditorProperties.InfectionOffset, new PropertyTypeVector4("_InfectionOffset") },
{ MaterialEditorProperties.InfectionNoiseTex, new PropertyTypeTexture("_InfectionNoiseTex") },
{ MaterialEditorProperties.InfectionSpeed, new PropertyTypeVector4("_InfectionSpeed") },
{ MaterialEditorProperties.ColorStrengthAtNight, new PropertyTypeColor("_ColorStrengthAtNight", true) },
{ MaterialEditorProperties.EmissUV, new PropertyTypeVector4("_EmissUV") },
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using UnityEngine;

namespace SubnauticaRuntimeEditor.Core.MaterialEditor
{
public class PropertyTypeTexture : PropertyType
{
public PropertyTypeTexture(string property) : base(property)
{
}

protected override void Draw(Material material)
{
var texture = material.GetTexture(Property);
var text = texture == null ? "Unassigned" : texture.name;
GUILayout.Label(text);
}

public override string GenerateSetPropertyCode(Material material)
{
return "Unimplemented";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace SubnauticaRuntimeEditor.Core
{
public class SubnauticaRuntimeEditorCore
{
public const string Version = "1.0.4";
public const string Version = "1.1.0";
public const string GUID = "SubnauticaRuntimeEditor";

[Obsolete("Use window Instance instead")] public Inspector.Inspector Inspector => Core.Inspector.Inspector.Initialized ? Core.Inspector.Inspector.Instance : null;
Expand Down
Loading

0 comments on commit 52f84ab

Please sign in to comment.