Version: 2023.1

Provider.UnlockIsValid

切换到手册
public static bool UnlockIsValid (VersionControl.AssetList assets);
public static bool UnlockIsValid (VersionControl.Asset asset);

参数

assets The asset list to test.
asset The asset to test.

描述

Returns true if unlocking the assets is a valid operation.

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