protected void DeleteAll(params string[] π) { foreach (var x in π) { if (x != null) { ADB.DeleteAsset(x); } } }
protected void CreateViaADB(params string[] π) { foreach (var x in π) { if (x != null) { ADB.CreateAsset(new TextAsset(), x); } } }
/// <summary> // This makes it easy to create, name and place unique new ScriptableObject asset files. /// </summary> public static void CreateAsset <T>(T asset) where T : ScriptableObject { string path = AssetDatabase.GetAssetPath(Selection.activeObject); if (path == "") { path = "Assets"; } else if (Path.GetExtension(path) != "") { path = path.Replace(Path.GetFileName(AssetDatabase.GetAssetPath(Selection.activeObject)), ""); } string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(path + "/New " + typeof(T).ToString() + ".asset"); AssetDatabase.CreateAsset(asset, assetPathAndName); AssetDatabase.SaveAssets(); EditorUtility.FocusProjectWindow(); Selection.activeObject = asset; }
protected void DeleteViaADB(string x) => ADB.DeleteAsset(x);