# UnlockIsValid

> Returns true if unlocking the assets is a valid operation.

## Definition

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

## UnlockIsValid(AssetList)

Returns true if unlocking the assets is a valid operation.

```csharp
public static bool UnlockIsValid(AssetList assets)
```

### Parameters

**** (\[AssetList]\(/engine/6000.5/script-reference/unityeditor/versioncontrol/assetlist)): The asset list to test.

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) |             |

### Examples

```csharp
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.VersionControl;
using UnityEngine;

public class EditorScript : MonoBehaviour
{
    [MenuItem("Version Control/UnlockIsValid")]
    public static void ExampleUnlockIsValid()
    {
        AssetList assets = new AssetList();
        assets.Add(Provider.GetAssetByPath("Assets/ExampleAsset.cs"));
        Debug.Log(Provider.UnlockIsValid(assets));
    }
}
```

## UnlockIsValid(Asset)

Returns true if unlocking the assets is a valid operation.

```csharp
public static bool UnlockIsValid(Asset asset)
```

### Parameters

**** (\[Asset]\(/engine/6000.5/script-reference/unityeditor/versioncontrol/asset)): The asset to test.

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) |             |

### Examples

```csharp
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.VersionControl;
using UnityEngine;

public class EditorScript : MonoBehaviour
{
    [MenuItem("Version Control/UnlockIsValid")]
    public static void ExampleUnlockIsValid()
    {
        AssetList assets = new AssetList();
        assets.Add(Provider.GetAssetByPath("Assets/ExampleAsset.cs"));
        Debug.Log(Provider.UnlockIsValid(assets));
    }
}
```
