Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


AreImporterTargetsValid()

Determines whether every inspected importer target still exists.
Read time 1 minuteLast updated 20 days ago

Definition

protected bool AreImporterTargetsValid()

Returns

Type

Description

boolReturns true if all target importers are still valid. Returns false if one or more targets have been destroyed, for example because the asset was deleted or its .meta GUID changed on disk.

Remarks

An AssetImporterEditor can outlive its target importer's native object. When this happens and the editor is re-enabled, accessing Editor.serializedObject or other target-dependent state throws. Call this method at the start of an OnEnable override before accessing such state, and return early when it returns false.