Unity - Scripting API: AssetDatabase.CanOpenAssetInEditor
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 CanOpenAssetInEditor(EntityId entityId);
Obsolete Please use CanOpenAssetInEditor(EntityId) with the EntityId parameter type instead.
Declaration
public static bool CanOpenAssetInEditor(int instanceID);
Parameters
| Parameter | Description |
|---|---|
| entityId | The EntityId of the asset. |
| instanceID | The instance ID of the asset. |
Returns
bool Returns true if Unity can successfully open the asset in the Editor, otherwise returns false.
Description
Checks if Unity can open an asset in the Editor.
Checks if Unity can open a given asset instance in the Editor if AssetDatabase.OpenAsset is executed. Note: The asset must be written to disk, or this function always returns false.