此标签适合添加在纹理属性标签前面,添加后,纹理属性会以小图标的形式绘制
MT 无需使用参数
需要定义 CustomEditor 为 BZTA.BZShaderGUI 或其子类
Shader "BZGUITest/MT"
{
Properties
{
[MT]_T("MainTex", 2D) = "White"{}
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
// make fog work
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
UNITY_TRANSFER_FOG(o,o.vertex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
return half4(0.382,0.2,0.2,1);
}
ENDCG
}
}
CustomEditor "BZTA.BZShaderGUI"
}