| Parameter | Description |
|---|---|
| entityId | The EntityId of the asset to open. |
| lineNumber | The line to open a text editor at, if the application supports it. The default value is -1, which opens the file at the start. |
bool True if the asset opened successfully. Otherwise, false.
Opens the asset with the specified EntityId in its associated application, optionally at a line.
Unity opens the asset in an external editor, image application, or modeling tool, depending on the type of asset.
| Parameter | Description |
|---|---|
| entityId | The EntityId of the asset to open. |
| lineNumber | The line to open a text editor at, if the application supports it. |
| columnNumber | The column to open a text editor at, if the application supports it. |
bool True if the asset opened successfully. Otherwise, false.
Opens the asset with the specified EntityId in its associated application, at a line and column.
Unity opens the asset in an external editor, image application, or modeling tool, depending on the type of asset.
| Parameter | Description |
|---|---|
| instanceID | The instance ID of the asset to open. |
| lineNumber | The line to open a text editor at, if the application supports it. |
| columnNumber | The column to open a text editor at, if the application supports it. |
bool True if the asset opened successfully. Otherwise, false.
Opens the asset with the specified instance ID in its associated application.
This overload is obsolete. Use the overload that takes an EntityId instead.
| Parameter | Description |
|---|---|
| target | The asset object to open. |
| lineNumber | The line to open a text editor at, if the application supports it. The default value is -1, which opens the file at the start. |
void True if the asset opened successfully. Otherwise, false.
Opens an asset object in its associated application, optionally at a line.
Unity opens the asset in an external editor, image application, or modeling tool, depending on the type of asset.
using UnityEditor; using UnityEngine;
public class AssetDatabaseExamples : MonoBehaviour { [MenuItem("AssetDatabase/Manually Check Textures")] static void OpenAssetExample() { for (var i = 0; i < 10; i++) { var texturePath = AssetDatabase.LoadMainAssetAtPath($"Assets/Textures/GroundTexture{i}.jpg"); if(!EditorUtility.DisplayDialog($"Open next texture", $"Open GroundTexture{i}.jpg texture?", "Yes", "Cancel")) break; AssetDatabase.OpenAsset(texturePath); } } }
| Parameter | Description |
|---|---|
| target | The asset object to open. |
| lineNumber | The line to open a text editor at, if the application supports it. |
| columnNumber | The column to open a text editor at, if the application supports it. |
void True if the asset opened successfully. Otherwise, false.
Opens an asset object in its associated application, at a line and column.
Unity opens the asset in an external editor, image application, or modeling tool, depending on the type of asset.
| Parameter | Description |
|---|---|
| objects | An array of asset objects to open. |
void Returns true if all assets opened successfully.
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.