[Add] All in one shader

This commit is contained in:
2026-02-23 22:01:07 +07:00
parent ec0aa86ac2
commit 4f942cd7c0
806 changed files with 401510 additions and 33 deletions
@@ -0,0 +1,43 @@
using UnityEditor;
using UnityEngine;
namespace AllIn13DShader
{
public class AllIn13DShaderGradientDrawer : MaterialPropertyDrawer
{
private GradientEditorDrawer gradientEditorDrawer;
private void RefreshReferences(MaterialProperty prop)
{
if(gradientEditorDrawer == null)
{
gradientEditorDrawer = new GradientEditorDrawer();
}
}
public override void OnGUI(Rect position, MaterialProperty prop, GUIContent label, MaterialEditor editor)
{
RefreshReferences(prop);
Texture texValue = prop.textureValue;
EditorGUI.BeginChangeCheck();
Texture newTex = gradientEditorDrawer.Draw(position, texValue);
if (EditorGUI.EndChangeCheck())
{
prop.textureValue = newTex;
}
}
public override float GetPropertyHeight(MaterialProperty prop, string label, MaterialEditor editor)
{
float res = 0f;
if(gradientEditorDrawer != null)
{
res = gradientEditorDrawer.GetPropertyHeight();
}
return res;
}
}
}