UnityEditor.ShaderUtil.GetCurrentShaderVariantCollectionShaderCount C# (CSharp) Method

GetCurrentShaderVariantCollectionShaderCount() private method

private GetCurrentShaderVariantCollectionShaderCount ( ) : int
return int
        internal static extern int GetCurrentShaderVariantCollectionShaderCount();
        [MethodImpl(MethodImplOptions.InternalCall)]

Usage Example

示例#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();
            }
All Usage Examples Of UnityEditor.ShaderUtil::GetCurrentShaderVariantCollectionShaderCount