5.1 HideLabel

添加此标签的属性,其所在的属性不会再绘制标签

用法

HideLabel 无需使用参数

需要定义 CustomEditor 为 BZTA.BZShaderGUI 或其子类

示例代码

Shader "BZGUITest/HidleLable"
{
    Properties
    {
        [HideLabel]_T("This is a beatiful label,but you can't see it", 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.8,0.5,0.2,1);
            }
            ENDCG
        }
    }
      CustomEditor "BZTA.BZShaderGUI"
}