OnPreprocessAsset()
Add this function to a subclass to get a notification just before any Asset is imported.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEditor
public void OnPreprocessAsset()
Remarks
This lets you control the import settings through code.
Examples
using UnityEditor;class MyModelPostprocessor : AssetPostprocessor{ void OnPreprocessAsset() { if (assetImporter.importSettingsMissing) { ModelImporter modelImporter = assetImporter as ModelImporter; if (modelImporter != null) { if (!assetPath.Contains("@")) modelImporter.importAnimation = false; modelImporter.materialImportMode = ModelImporterMaterialImportMode.None; } } }}