# OpenAsset

> Opens the asset with associated application.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.6/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

## OpenAsset(EntityId, int)

Opens the asset with associated application.

```csharp
public static bool OpenAsset(EntityId entityId, int lineNumber)
```

### Parameters

**** (\[EntityId]\(/engine/6000.6/script-reference/unityengine/entityid)): The EntityID of the asset.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The line number to open the text editor at, if appropriate.

### Returns

| Type                                                          | Description                                                     |
| ------------------------------------------------------------- | --------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the asset opened successfully, otherwise false. |

### Remarks

Opens asset in an external editor, texture application or modelling tool depending on what type of asset it is.

### Examples

```csharp
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);
        }
    }
}
```

## OpenAsset(int, int)

Opens the asset with associated application.

> **Warning:**
>
> **Removed.** Please use OpenAsset(EntityId, int) with the EntityId parameter type instead.

```csharp
public static bool OpenAsset(int instanceID, int lineNumber)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The InstanceID of the asset.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The line number to open the text editor at, if appropriate.

### Returns

| Type                                                          | Description                                                     |
| ------------------------------------------------------------- | --------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the asset opened successfully, otherwise false. |

### Remarks

Opens asset in an external editor, texture application or modelling tool depending on what type of asset it is.

### Examples

```csharp
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);
        }
    }
}
```

## OpenAsset(EntityId, int, int)

Opens the asset with associated application.

```csharp
public static bool OpenAsset(EntityId entityId, int lineNumber, int columnNumber)
```

### Parameters

**** (\[EntityId]\(/engine/6000.6/script-reference/unityengine/entityid)): The EntityID of the asset.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The line number to open the text editor at, if appropriate.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The column number to open the text editor at, if appropriate.

### Returns

| Type                                                          | Description                                                     |
| ------------------------------------------------------------- | --------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the asset opened successfully, otherwise false. |

### Remarks

Opens asset in an external editor, texture application or modelling tool depending on what type of asset it is.

### Examples

```csharp
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);
        }
    }
}
```

## OpenAsset(int, int, int)

Opens the asset with associated application.

> **Warning:**
>
> **Removed.** Please use OpenAsset(EntityId, int, int) with the EntityId parameter type instead.

```csharp
public static bool OpenAsset(int instanceID, int lineNumber, int columnNumber)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The InstanceID of the asset.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The line number to open the text editor at, if appropriate.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The column number to open the text editor at, if appropriate.

### Returns

| Type                                                          | Description                                                     |
| ------------------------------------------------------------- | --------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the asset opened successfully, otherwise false. |

### Remarks

Opens asset in an external editor, texture application or modelling tool depending on what type of asset it is.

### Examples

```csharp
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);
        }
    }
}
```

## OpenAsset(Object, int)

Opens the asset with associated application.

```csharp
public static bool OpenAsset(Object target, int lineNumber)
```

### Parameters

**** (\[Object]\(/engine/6000.6/script-reference/unityengine/object)): The asset object.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The line number to open the text editor at, if appropriate.

### Returns

| Type                                                          | Description                                                     |
| ------------------------------------------------------------- | --------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the asset opened successfully, otherwise false. |

### Remarks

Opens asset in an external editor, texture application or modelling tool depending on what type of asset it is.

### Examples

```csharp
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);
        }
    }
}
```

## OpenAsset(Object, int, int)

Opens the asset with associated application.

```csharp
public static bool OpenAsset(Object target, int lineNumber, int columnNumber)
```

### Parameters

**** (\[Object]\(/engine/6000.6/script-reference/unityengine/object)): The asset object.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The line number to open the text editor at, if appropriate.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The column number to open the text editor at, if appropriate.

### Returns

| Type                                                          | Description                                                     |
| ------------------------------------------------------------- | --------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the asset opened successfully, otherwise false. |

### Remarks

Opens asset in an external editor, texture application or modelling tool depending on what type of asset it is.

### Examples

```csharp
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);
        }
    }
}
```

## OpenAsset(Object\[])

Opens multiple assets with their associated applications.

```csharp
public static bool OpenAsset(Object[] objects)
```

### Parameters

**** (\[Object\[]]\(/engine/6000.6/script-reference/unityengine/object)): An array of asset objects to open.

### Returns

| Type                                                          | Description                                     |
| ------------------------------------------------------------- | ----------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if all assets opened successfully. |

### Remarks

Opens the assets in an external editor, texture application or modelling tool depending on what type of asset it is.
