private void DoShaderVariants(EditorWindow caller, ref Rect drawPos)
        {
            EditorGUI.BeginChangeCheck();
            bool flag = GUI.Toggle(drawPos, ShaderInspectorPlatformsPopup.currentVariantStripping == 1, EditorGUIUtility.TempContent("Skip unused shader_features"), ShaderInspectorPlatformsPopup.Styles.menuItem);

            drawPos.y += 16f;
            if (EditorGUI.EndChangeCheck())
            {
                ShaderInspectorPlatformsPopup.currentVariantStripping = ((!flag) ? 0 : 1);
            }
            drawPos.y += 6f;
            ulong  variantCount = ShaderUtil.GetVariantCount(this.m_Shader, flag);
            string text         = ShaderInspectorPlatformsPopup.FormatCount(variantCount) + ((!flag) ? " variants total" : " variants included");
            Rect   position     = drawPos;

            position.x     += (float)ShaderInspectorPlatformsPopup.Styles.menuItem.padding.left;
            position.width -= (float)(ShaderInspectorPlatformsPopup.Styles.menuItem.padding.left + 4);
            GUI.Label(position, text);
            position.xMin = position.xMax - 40f;
            if (GUI.Button(position, "Show", EditorStyles.miniButton))
            {
                ShaderUtil.OpenShaderCombinations(this.m_Shader, flag);
                caller.Close();
                GUIUtility.ExitGUI();
            }
        }
Ejemplo n.º 2
0
 public ShaderInspectorPlatformsPopup(Shader shader)
 {
     this.m_Shader = shader;
     ShaderInspectorPlatformsPopup.InitializeShaderPlatforms();
 }