Unity - Scripting API: AssetDatabase.IsForeignAsset
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.
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.
Declaration
public static bool IsForeignAsset(Object obj);
Declaration
public static bool IsForeignAsset(EntityId entityId);
Obsolete Please use IsForeignAsset(EntityId) with the EntityId type instead.
Declaration
public static bool IsForeignAsset(int instanceID);
Parameters
| Parameter | Description |
|---|---|
| obj | The object of the asset. |
| entityId | The EntityID of the asset. |
| instanceID | The InstanceID of the asset. |
Returns
bool Returns true if the asset is a foreign asset, and false otherwise.
Description
Determines whether a given asset is an external asset, also known as a foreign asset.
A foreign asset is any asset that isn't created within Unity, for example a .png texture file. An asset created in Unity is a Native asset importers reference, for example a material or a prefab.
Unity creates a serialized representation of foreign assets in the Project's Library folder during import. This happens when the asset is first added, when it's updated externally, or when you modify its import settings in the Editor.
Additional resources: AssetDatabase.IsNativeAsset.