# CanOpenForEdit

> Query which of the provided Asset files can be opened for editing in version control and are not remotely locked or otherwise unavailable.

## Definition

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

## CanOpenForEdit(string\[], List\<string>, StatusQueryOptions)

Query which of the provided Asset files can be opened for editing in version control and are not remotely locked or otherwise unavailable.

```csharp
public static void CanOpenForEdit(string[] assetOrMetaFilePaths, List<string> outNotEditablePaths, StatusQueryOptions statusQueryOptions = StatusQueryOptions.UseCachedIfPossible)
```

### Parameters

**** (\[string\[]]\(https\://learn.microsoft.com/dotnet/api/system.string)): Paths to Assets or their .meta files, relative to the project folder.**** (\[List\<string>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): Destination list of non-editable Asset paths.**** (\[StatusQueryOptions]\(/engine/6000.6/script-reference/unityeditor/statusqueryoptions)): Specifies how Unity should query the version control system. The default value is [StatusQueryOptions.UseCachedIfPossible](/engine/6000.6/script-reference/unityeditor/statusqueryoptions/usecachedifpossible.md).

### Remarks

This variant of the `CanOpenForEdit` function can query multiple Asset paths at once. It writes paths for Assets that are not 'available for edit' into the `outNotEditablePaths` list.

## CanOpenForEdit(Object, StatusQueryOptions)

Query whether an Asset file can be opened for editing in version control and is not exclusively locked by another user or otherwise unavailable.

```csharp
public static bool CanOpenForEdit(Object assetObject, StatusQueryOptions statusOptions)
```

### Parameters

**** (\[Object]\(/engine/6000.6/script-reference/unityengine/object)): Object representing the asset whose status you wish to query.**** (\[StatusQueryOptions]\(/engine/6000.6/script-reference/unityeditor/statusqueryoptions)): Options for how the version control system should be queried. These options can effect the speed and accuracy of the query. Default is [StatusQueryOptions.UseCachedIfPossible](/engine/6000.6/script-reference/unityeditor/statusqueryoptions/usecachedifpossible.md).

### Returns

| Type                                                          | Description                                                                                |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the asset is considered available for edit by the selected version control system. |

### Remarks

See [AssetDatabase.IsOpenForEdit](/engine/6000.6/script-reference/unityeditor/assetdatabase/isopenforedit.md) for detailed explanation.

Additional Resources: [StatusQueryOptions](/engine/6000.6/script-reference/unityeditor/statusqueryoptions.md), [AssetDatabase.MakeEditable](/engine/6000.6/script-reference/unityeditor/assetdatabase/makeeditable.md).

## CanOpenForEdit(string, StatusQueryOptions)

Query whether an Asset file can be opened for editing in version control and is not exclusively locked by another user or otherwise unavailable.

```csharp
public static bool CanOpenForEdit(string assetOrMetaFilePath, StatusQueryOptions statusOptions)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Path to the asset file or its .meta file on disk, relative to project folder.**** (\[StatusQueryOptions]\(/engine/6000.6/script-reference/unityeditor/statusqueryoptions)): Options for how the version control system should be queried. These options can effect the speed and accuracy of the query. Default is [StatusQueryOptions.UseCachedIfPossible](/engine/6000.6/script-reference/unityeditor/statusqueryoptions/usecachedifpossible.md).

### Returns

| Type                                                          | Description                                                                                |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the asset is considered available for edit by the selected version control system. |

### Remarks

See [AssetDatabase.IsOpenForEdit](/engine/6000.6/script-reference/unityeditor/assetdatabase/isopenforedit.md) for detailed explanation.

Additional Resources: [StatusQueryOptions](/engine/6000.6/script-reference/unityeditor/statusqueryoptions.md), [AssetDatabase.MakeEditable](/engine/6000.6/script-reference/unityeditor/assetdatabase/makeeditable.md).

## CanOpenForEdit(Object, string, StatusQueryOptions)

Query whether an Asset file can be opened for editing in version control and is not exclusively locked by another user or otherwise unavailable.

```csharp
public static bool CanOpenForEdit(Object assetObject, out string message, StatusQueryOptions statusOptions)
```

### Parameters

**** (\[Object]\(/engine/6000.6/script-reference/unityengine/object)): Object representing the asset whose status you wish to query.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Returns a reason for the asset not being available for edit.**** (\[StatusQueryOptions]\(/engine/6000.6/script-reference/unityeditor/statusqueryoptions)): Options for how the version control system should be queried. These options can effect the speed and accuracy of the query. Default is [StatusQueryOptions.UseCachedIfPossible](/engine/6000.6/script-reference/unityeditor/statusqueryoptions/usecachedifpossible.md).

### Returns

| Type                                                          | Description                                                                                |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the asset is considered available for edit by the selected version control system. |

### Remarks

See [AssetDatabase.IsOpenForEdit](/engine/6000.6/script-reference/unityeditor/assetdatabase/isopenforedit.md) for detailed explanation.

Additional Resources: [StatusQueryOptions](/engine/6000.6/script-reference/unityeditor/statusqueryoptions.md), [AssetDatabase.MakeEditable](/engine/6000.6/script-reference/unityeditor/assetdatabase/makeeditable.md).

## CanOpenForEdit(string, string, StatusQueryOptions)

Query whether an Asset file can be opened for editing in version control and is not exclusively locked by another user or otherwise unavailable.

```csharp
public static bool CanOpenForEdit(string assetOrMetaFilePath, out string message, StatusQueryOptions statusOptions)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Path to the asset file or its .meta file on disk, relative to project folder.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Returns a reason for the asset not being available for edit.**** (\[StatusQueryOptions]\(/engine/6000.6/script-reference/unityeditor/statusqueryoptions)): Options for how the version control system should be queried. These options can effect the speed and accuracy of the query. Default is [StatusQueryOptions.UseCachedIfPossible](/engine/6000.6/script-reference/unityeditor/statusqueryoptions/usecachedifpossible.md).

### Returns

| Type                                                          | Description                                                                                |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the asset is considered available for edit by the selected version control system. |

### Remarks

See [AssetDatabase.IsOpenForEdit](/engine/6000.6/script-reference/unityeditor/assetdatabase/isopenforedit.md) for detailed explanation.

Additional Resources: [StatusQueryOptions](/engine/6000.6/script-reference/unityeditor/statusqueryoptions.md), [AssetDatabase.MakeEditable](/engine/6000.6/script-reference/unityeditor/assetdatabase/makeeditable.md).
