Ejemplo n.º 1
0
 public static AssetDeleteResult OnWillDeleteAsset(string π, RemoveOpt opt)
 {
     if (π.HasBuildImage())
     {
         π.BuildPath().DeleteFileOrDir(withMetaFile: true);
         ADB.Refresh();
         return(DidNotDelete);
     }
     else if (π.IsHowlBound())
     {
         log.error = "Do not modify Howl-bound assets";
         return(FailedDelete);
     }
     else
     {
         return(DidNotDelete);
     }
 }
Ejemplo n.º 2
0
 private static UnityEditor.AssetDeleteResult OnWillDeleteAsset(string assetToDelete, UnityEditor.RemoveAssetOptions removeAssetOptions)
 {
     System.Type t = AssetDatabase.GetMainAssetTypeAtPath(assetToDelete);
     if (t != null ? !t.GetInterfaces().Contains(typeof(IOnWillDeleteAssetCallback)) : true)
     {
         return(UnityEditor.AssetDeleteResult.DidNotDelete);
     }
     object[] assets = UnityEditor.AssetDatabase.LoadAllAssetsAtPath(assetToDelete);
     if (assets != null)
     {
         for (int ii = 0; ii < assets.Length; ii++)
         {
             IOnWillDeleteAssetCallback onWillDelete = (IOnWillDeleteAssetCallback)assets[ii];
             if (onWillDelete != null)
             {
                 onWillDelete.OnWillDelete();
             }
         }
     }
     return(UnityEditor.AssetDeleteResult.DidNotDelete);
 }