Unity - Scripting API: AssetDatabase.IsMainAsset
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 IsMainAsset(Object obj);
Declaration
public static bool IsMainAsset(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 True if the asset is a main asset, false otherwise.
Description
Checks whether the asset is a main asset in the Project window.
For example, an imported model has a GameObject as its root and several meshes and child GameObjects in an expanded state. The root GameObject is the main asset in this case.