ドキュメント

Unity Engine

Unity Engine

OnPreprocessAsset()

Add this function to a subclass to get a notification just before any Asset is imported.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

public void OnPreprocessAsset()

Remarks

This lets you control the import settings through code.

Examples

using UnityEditor;class MyModelPostprocessor : AssetPostprocessor{ // Increment the version number, when the AssetPostprocessors code/behavior is changed static readonly uint k_Version = 0; public override uint GetVersion() { return k_Version; } void OnPreprocessAsset() { if (assetImporter.importSettingsMissing) { ModelImporter modelImporter = assetImporter as ModelImporter; if (modelImporter != null) { if (!assetPath.Contains("@")) modelImporter.importAnimation = false; modelImporter.materialImportMode = ModelImporterMaterialImportMode.None; } } }}