private void ImportBtn_clicked()
        {
            string resultPath = EditorTools.OpenFilePath("Import XML", "Assets/", "xml");

            if (resultPath != null)
            {
                AssetBundleCollectorConfig.ImportXmlConfig(resultPath);
                RefreshWindow();
            }
        }
Exemple #2
0
        private void OnGUI()
        {
            EditorGUILayout.Space();
            ShaderVariantCollectorSettingData.Setting.SavePath = EditorGUILayout.TextField("收集文件保存路径", ShaderVariantCollectorSettingData.Setting.SavePath);

            int currentShaderCount  = ShaderVariantCollector.GetCurrentShaderVariantCollectionShaderCount();
            int currentVariantCount = ShaderVariantCollector.GetCurrentShaderVariantCollectionVariantCount();

            EditorGUILayout.LabelField($"CurrentShaderCount : {currentShaderCount}");
            EditorGUILayout.LabelField($"CurrentVariantCount : {currentVariantCount}");

            // 搜集变种
            EditorGUILayout.Space();
            if (GUILayout.Button("搜集变种", GUILayout.MaxWidth(80)))
            {
                ShaderVariantCollector.Run(ShaderVariantCollectorSettingData.Setting.SavePath);
            }

            // 查询
            EditorGUILayout.Space();
            if (GUILayout.Button("查询", GUILayout.MaxWidth(80)))
            {
                string resultPath = EditorTools.OpenFilePath("Select File", "Assets/", "shadervariants");
                if (string.IsNullOrEmpty(resultPath))
                {
                    return;
                }
                string assetPath = EditorTools.AbsolutePathToAssetPath(resultPath);
                _selectSVC = AssetDatabase.LoadAssetAtPath <ShaderVariantCollection>(assetPath);
            }
            if (_selectSVC != null)
            {
                EditorGUILayout.LabelField($"ShaderCount : {_selectSVC.shaderCount}");
                EditorGUILayout.LabelField($"VariantCount : {_selectSVC.variantCount}");
            }
        }