//所有的资源的导入,删除,移动,都会调用此方法,注意,这个方法是static的 public static void OnPostprocessAllAssets(string[] importedAsset, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { for (int i = 0; i < importedAsset.Length; i++) { Debug.Log($"{importedAsset[i]}"); } fileAssets.Clear(); floderAssets.Clear(); CheckAssetPathArray(importedAsset, "importedAsset", true); CheckAssetPathArray(deletedAssets, "deletedAssets", false); CheckAssetPathArray(movedAssets, "movedAssets", true); CheckAssetPathArray(movedFromAssetPaths, "movedFromAssetPaths", false); //通知资源检查工具。 //1 检查资源格式 //2 检查资源目录结构 //3 自定更新文件打包策略 ResourceChecker.OnPostprocessAllAssets(fileAssets, floderAssets); }
//音频导入之前 public void OnPreprocessAudio() { ResourceChecker.OnPreprocessAudio(assetPath, assetImporter); }
//音频导入之后 public void OnPostprocessAudio(AudioClip clip) { ResourceChecker.OnPostprocessAudio(assetPath, assetImporter, clip); }
//文理导入之后 public void OnPostprocessTexture(Texture2D tex) { ResourceChecker.OnPostprocessTexture(assetPath, assetImporter, tex); }
//纹理导入之前调用,针对入到的纹理进行设置 public void OnPreprocessTexture() { ResourceChecker.OnPreprocessTexture(assetPath, assetImporter); }
//模型导入之前调用 public void OnPostprocessModel(GameObject go) { ResourceChecker.OnPostprocessModel(assetPath, assetImporter, go); }
//模型导入之前调用 public void OnPreprocessModel() { ResourceChecker.OnPreprocessModel(assetPath, assetImporter); }
protected virtual Material OnAssignMaterialModel(Material previousMaterial, Renderer renderer) { return(ResourceChecker.OnAssignMaterialModel(previousMaterial, renderer)); }