UnityEditor.ShaderUtil.HasShaderSnippets C# (CSharp) Method

HasShaderSnippets() private method

private HasShaderSnippets ( Shader s ) : bool
s UnityEngine.Shader
return bool
        internal static extern bool HasShaderSnippets(Shader s);
        [MethodImpl(MethodImplOptions.InternalCall)]

Usage Example

示例#1
0
        private void ShowCompiledCodeButton(Shader s)
        {
            EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
            EditorGUILayout.PrefixLabel("Compiled code", EditorStyles.miniButton);
            bool flag = ShaderUtil.HasShaderSnippets(s) || ShaderUtil.HasSurfaceShaders(s) || ShaderUtil.HasFixedFunctionShaders(s);

            if (flag)
            {
                GUIContent showCurrent = ShaderInspector.Styles.showCurrent;
                Rect       rect        = GUILayoutUtility.GetRect(showCurrent, EditorStyles.miniButton, new GUILayoutOption[]
                {
                    GUILayout.ExpandWidth(false)
                });
                Rect position = new Rect(rect.xMax - 16f, rect.y, 16f, rect.height);
                if (EditorGUI.DropdownButton(position, GUIContent.none, FocusType.Passive, GUIStyle.none))
                {
                    Rect last = GUILayoutUtility.topLevel.GetLast();
                    PopupWindow.Show(last, new ShaderInspectorPlatformsPopup(s));
                    GUIUtility.ExitGUI();
                }
                if (GUI.Button(rect, showCurrent, EditorStyles.miniButton))
                {
                    ShaderUtil.OpenCompiledShader(s, ShaderInspectorPlatformsPopup.currentMode, ShaderInspectorPlatformsPopup.currentPlatformMask, ShaderInspectorPlatformsPopup.currentVariantStripping == 0);
                    GUIUtility.ExitGUI();
                }
            }
            else
            {
                GUILayout.Button("none (precompiled shader)", GUI.skin.label, new GUILayoutOption[0]);
            }
            EditorGUILayout.EndHorizontal();
        }
All Usage Examples Of UnityEditor.ShaderUtil::HasShaderSnippets