public static void OptimizeMeshSelection(ChangeMesh c) { AssetDatabase.StartAssetEditing(); foreach(Object obj in Textures()){ string path = AssetDatabase.GetAssetPath(obj); ModelImporter import = AssetImporter.GetAtPath(path) as ModelImporter; if(import == null) continue; Debug.Log("Settings for: " + path); c(import); EditorUtility.SetDirty(obj); AssetDatabase.ImportAsset(path, ImportAssetOptions.ForceUpdate); } EditorUtility.DisplayCancelableProgressBar("Optimizing stuff...", "Still gotta refresh, but hit revert when it asks.", 0.99f); AssetDatabase.StopAssetEditing(); //AssetDatabase.Refresh(); EditorUtility.ClearProgressBar(); }
public BasePropertyChanger GetPropertyChanger() { ChangeMesh result = new ChangeMesh(); if (cmbMesh.SelectedItem != null) { result.SetValue(cmbMesh.SelectedItem as string); } return(result); }