Example #1
0
 protected void DeleteAll(params string[] π)
 {
     foreach (var x in π)
     {
         if (x != null)
         {
             ADB.DeleteAsset(x);
         }
     }
 }
Example #2
0
 protected void CreateViaADB(params string[] π)
 {
     foreach (var x in π)
     {
         if (x != null)
         {
             ADB.CreateAsset(new TextAsset(), x);
         }
     }
 }
Example #3
0
        /// <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;
        }
Example #4
0
 protected void DeleteViaADB(string x) => ADB.DeleteAsset(x);