public static InteractiveAssetSelector ExportSelector(Object[] assets, string description = "") { InteractiveAssetSelector ias = InitSelector(assets); ias.description = string.IsNullOrEmpty(description) ? "Assets to Export" : description; ias.OnOptionsGUI = ExportOptionsGUI; return(ias); }
public static InteractiveAssetSelector InitSelector(string[] selection) { InteractiveAssetSelector ias = GetWindow <InteractiveAssetSelector>(true, "Select Assets", true); ias.SortedInsert(selection, false); ias.ValidateSelection(); return(ias); }
public static void ExportOptionsGUI(InteractiveAssetSelector selector) { EditorGUILayout.BeginHorizontal(); if (GUILayout.Button(new GUIContent("Include Dependencies", "Include dependencies of the selection"))) { // AssetDatabase.SaveAssets();//This is allows GetDependencies to get updated dependencies (may give trouble) selector.SortedInsert(AssetDatabase.GetDependencies(selector.GetSelectedPaths(), true), false); } GUILayout.FlexibleSpace(); if (GUILayout.Button("Export...")) { selector.ExportSelection(); } EditorGUILayout.EndHorizontal(); }
public static InteractiveAssetSelector ExportSelector() { InteractiveAssetSelector ias = ExportSelector(Selection.GetFiltered(typeof(Object), SelectionMode.DeepAssets)); return(ias); }