UnityEditor.ShaderUtil.GetShaderPropertyAttributes C# (CSharp) Method

GetShaderPropertyAttributes() private method

private GetShaderPropertyAttributes ( Shader s, string name ) : string[]
s UnityEngine.Shader
name string
return string[]
        internal static extern string[] GetShaderPropertyAttributes(Shader s, string name);
        [MethodImpl(MethodImplOptions.InternalCall)]

Usage Example

        private static MaterialPropertyHandler GetShaderPropertyHandler(Shader shader, string name)
        {
            string[] propertyAttributes = ShaderUtil.GetShaderPropertyAttributes(shader, name);
            if (propertyAttributes == null || propertyAttributes.Length == 0)
            {
                return((MaterialPropertyHandler)null);
            }
            MaterialPropertyHandler materialPropertyHandler = new MaterialPropertyHandler();

            foreach (string attrib in propertyAttributes)
            {
                bool isDecorator;
                MaterialPropertyDrawer shaderPropertyDrawer = MaterialPropertyHandler.GetShaderPropertyDrawer(attrib, out isDecorator);
                if (shaderPropertyDrawer != null)
                {
                    if (isDecorator)
                    {
                        if (materialPropertyHandler.m_DecoratorDrawers == null)
                        {
                            materialPropertyHandler.m_DecoratorDrawers = new List <MaterialPropertyDrawer>();
                        }
                        materialPropertyHandler.m_DecoratorDrawers.Add(shaderPropertyDrawer);
                    }
                    else
                    {
                        if (materialPropertyHandler.m_PropertyDrawer != null)
                        {
                            Debug.LogWarning((object)string.Format("Shader property {0} already has a property drawer", (object)name), (UnityEngine.Object)shader);
                        }
                        materialPropertyHandler.m_PropertyDrawer = shaderPropertyDrawer;
                    }
                }
            }
            return(materialPropertyHandler);
        }
All Usage Examples Of UnityEditor.ShaderUtil::GetShaderPropertyAttributes