Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

AssetImporterEditor.AreImporterTargetsValid

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

protected bool AreImporterTargetsValid();

Returns

bool Returns 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.

Description

Determines whether every inspected importer target still exists.

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.