private static List <ShaderVariantCollection> GetProjectShaderVariantCollections() { List <ShaderVariantCollection> collections = new List <ShaderVariantCollection>(); var guids = AssetDatabase.FindAssets("t: ShaderVariantCollection"); foreach (var guid in guids) { var path = AssetDatabase.GUIDToAssetPath(guid); var obj = AssetDatabase.LoadAssetAtPath <ShaderVariantCollection>(path); if (obj != null) { collections.Add(obj); } } var excludeList = StripShaderConfig.GetVariantCollectionAsset(); foreach (var exclude in excludeList) { if (exclude != null) { collections.Remove(exclude); } } return(collections); }
private void SetupExcludeRules() { this.collections = StripShaderConfig.GetVariantCollectionAsset(); #if UNITY_2021_2_OR_NEWER excludeVariantListView.fixedItemHeight = 20; #else excludeVariantListView.itemHeight = 20; #endif excludeVariantListView.reorderable = true; excludeVariantListView.makeItem = () => { return(new VariantCollectionUI(OnChangeExclueValue, OnRemoveExclude)); }; excludeVariantListView.bindItem = (e, i) => { var variantUI = (e as VariantCollectionUI); variantUI.variantCollection = collections[i]; variantUI.ListIndex = i; }; excludeVariantListView.itemsSource = collections; RefleshExcludeUI(); }