CodeSmile AssetDatabase 1.9
Unity's AssetDatabase in enjoyable, consistent, concise, convenient, comprehensible, safe, documented form.
Loading...
Searching...
No Matches

◆ Exists

Boolean Exists
get

Returns true if the path exists in the AssetDatabase.

This may still return true for asset files that have been deleted externally if those changes have not been imported via CodeSmileEditor.Asset.Database.ImportAll.

In Unity 2023.2 or newer uses the new AssetPathExists method. In earlier versions AssetPathToGUID is used.

See also

Definition at line 57 of file Asset.Path.cs.

58 {
59 get
60 {
61#if UNITY_2023_2_OR_NEWER
62 return AssetDatabase.AssetPathExists(m_RelativePath);
63#else
64 return AssetDatabase.AssetPathToGUID(m_RelativePath, AssetPathToGUIDOptions.OnlyExistingAssets).Length > 0;
65#endif
66 }
67 }