GetCurrentShaderVariantCollectionShaderCount() private method

private GetCurrentShaderVariantCollectionShaderCount ( ) : int
return int
示例#1
0
            public override void OnInspectorGUI()
            {
                serializedObject.Update();

                serializedObject.ApplyModifiedProperties();

                EditorGUILayout.PropertyField(m_PreloadedShaders, true);

                EditorGUILayout.Space();
                GUILayout.Label(
                    string.Format("Currently tracked: {0} shaders {1} total variants",
                                  ShaderUtil.GetCurrentShaderVariantCollectionShaderCount(), ShaderUtil.GetCurrentShaderVariantCollectionVariantCount()
                                  )
                    );

                EditorGUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                if (GUILayout.Button(Styles.shaderPreloadSave, EditorStyles.miniButton))
                {
                    string message   = "Save shader variant collection";
                    string assetPath = EditorUtility.SaveFilePanelInProject("Save Shader Variant Collection", "NewShaderVariants", "shadervariants", message, ProjectWindowUtil.GetActiveFolderPath());
                    if (!string.IsNullOrEmpty(assetPath))
                    {
                        ShaderUtil.SaveCurrentShaderVariantCollection(assetPath);
                    }
                    GUIUtility.ExitGUI();
                }
                if (GUILayout.Button(Styles.shaderPreloadClear, EditorStyles.miniButton))
                {
                    ShaderUtil.ClearCurrentShaderVariantCollection();
                }
                EditorGUILayout.EndHorizontal();

                serializedObject.ApplyModifiedProperties();
            }
示例#2
0
 public override void OnInspectorGUI()
 {
     base.serializedObject.ApplyModifiedProperties();
     EditorGUILayout.PropertyField(this.m_PreloadedShaders, true, new GUILayoutOption[0]);
     EditorGUILayout.Space();
     GUILayout.Label($"Currently tracked: {ShaderUtil.GetCurrentShaderVariantCollectionShaderCount()} shaders {ShaderUtil.GetCurrentShaderVariantCollectionVariantCount()} total variants", new GUILayoutOption[0]);
     EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
     GUILayout.FlexibleSpace();
     if (GUILayout.Button(Styles.shaderPreloadSave, EditorStyles.miniButton, new GUILayoutOption[0]))
     {
         string message = "Save shader variant collection";
         string str2    = EditorUtility.SaveFilePanelInProject("Save Shader Variant Collection", "NewShaderVariants", "shadervariants", message, ProjectWindowUtil.GetActiveFolderPath());
         if (!string.IsNullOrEmpty(str2))
         {
             ShaderUtil.SaveCurrentShaderVariantCollection(str2);
         }
         GUIUtility.ExitGUI();
     }
     if (GUILayout.Button(Styles.shaderPreloadClear, EditorStyles.miniButton, new GUILayoutOption[0]))
     {
         ShaderUtil.ClearCurrentShaderVariantCollection();
     }
     EditorGUILayout.EndHorizontal();
     base.serializedObject.ApplyModifiedProperties();
 }
示例#3
0
 private void ShaderPreloadGUI()
 {
     EditorGUILayout.Space();
     GUILayout.Label(GraphicsSettingsInspector.Styles.shaderPreloadSettings, EditorStyles.boldLabel, new GUILayoutOption[0]);
     EditorGUILayout.PropertyField(this.m_PreloadedShaders, true, new GUILayoutOption[0]);
     EditorGUILayout.Space();
     GUILayout.Label(string.Format("Currently tracked: {0} shaders {1} total variants", (object)ShaderUtil.GetCurrentShaderVariantCollectionShaderCount(), (object)ShaderUtil.GetCurrentShaderVariantCollectionVariantCount()));
     EditorGUILayout.BeginHorizontal();
     GUILayout.FlexibleSpace();
     if (GUILayout.Button(GraphicsSettingsInspector.Styles.shaderPreloadSave, EditorStyles.miniButton, new GUILayoutOption[0]))
     {
         string path = EditorUtility.SaveFilePanelInProject("Save Shader Variant Collection", "NewShaderVariants", "shadervariants", "Save shader variant collection", ProjectWindowUtil.GetActiveFolderPath());
         if (!string.IsNullOrEmpty(path))
         {
             ShaderUtil.SaveCurrentShaderVariantCollection(path);
         }
         GUIUtility.ExitGUI();
     }
     if (GUILayout.Button(GraphicsSettingsInspector.Styles.shaderPreloadClear, EditorStyles.miniButton, new GUILayoutOption[0]))
     {
         ShaderUtil.ClearCurrentShaderVariantCollection();
     }
     EditorGUILayout.EndHorizontal();
 }