| Parameter | Description |
|---|---|
| obj | The asset object to check. |
bool True if the asset is a native asset. Otherwise, false.
Checks whether an asset object is a native asset, created by Unity.
A native asset is a file that Unity's serialization system creates directly, for example a .mat material file. Scenes, prefabs, and assembly definitions aren't native assets. An asset created outside Unity, such as a .png texture file, is a foreign asset. For more information, refer to Native asset importers reference and AssetDatabase.IsForeignAsset.
using UnityEditor; using UnityEngine;
public class AssetDatabaseExamples : MonoBehaviour { [MenuItem("AssetDatabase/List All Native Files")] static void ListNativeFiles() { //List all native assets in the project foreach (var guid in AssetDatabase.FindAssets("", new []{"Assets"})) { var path = AssetDatabase.GUIDToAssetPath(guid); var asset = AssetDatabase.LoadMainAssetAtPath(path); if(AssetDatabase.IsNativeAsset(asset)) Debug.Log(asset); } } }
| Parameter | Description |
|---|---|
| entityId | The EntityId of the asset to check. |
bool True if the asset is a native asset. Otherwise, false.
Checks whether the asset with the specified EntityId is a native asset, created by Unity.
A native asset is a file that Unity's serialization system creates directly, for example a .mat material file. Scenes, prefabs, and assembly definitions aren't native assets. An asset created outside Unity, such as a .png texture file, is a foreign asset. For more information, refer to Native asset importers reference and AssetDatabase.IsForeignAsset.
| Parameter | Description |
|---|---|
| instanceID | The instance ID of the asset to check. |
bool True if the asset is a native asset. Otherwise, false.
Checks whether the asset with the specified instance ID is a native asset, created by Unity.
This overload is obsolete. Use the overload that takes an EntityId instead.