Unity - Scripting API: AssetDatabase.OpenAsset
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 OpenAsset(int instanceID, int lineNumber = -1);
Declaration
public static bool OpenAsset(int instanceID, int lineNumber, int columnNumber);
Declaration
public static bool OpenAsset(Object target, int lineNumber = -1);
Declaration
public static bool OpenAsset(Object target, int lineNumber, int columnNumber);
Parameters
| Parameter | Description |
|---|---|
| lineNumber | The line number to open the text editor at, if appropriate. |
| columnNumber | The column number to open the text editor at, if appropriate. |
| instanceID | The InstanceID of the asset. |
| target | The asset object. |
Returns
bool Returns true if the asset opened successfully, otherwise false.
Description
Opens the asset with associated application.
Opens asset in an external editor, texture application or modelling tool depending on what type of asset it is.
Declaration
public static bool OpenAsset(Object[] objects);
Parameters
| Parameter | Description |
|---|---|
| objects | An array of asset objects to open. |
Returns
bool Returns true if all assets opened successfully.
Description
Opens multiple assets with their associated applications.
Opens the assets in an external editor, texture application or modelling tool depending on what type of asset it is.