assets | 要测试的资产列表。 |
该任务测试给定的资产列表,如果 Provider.GetLatest 对一个或多个资产是有效的操作,则返回 true。
using System.Collections.Generic; using UnityEditor; using UnityEditor.VersionControl; using UnityEngine;
public class EditorScript : MonoBehaviour { [MenuItem("Version Control/GetLatestIsValid")] public static void ExampleGetLatestIsValid() { AssetList assets = new AssetList(); assets.Add(Provider.GetAssetByPath("Assets/ExampleAsset.cs")); assets.Add(Provider.GetAssetByPath("Assets/ExampleAsset.cs.meta")); Task t = Provider.GetLatest(assets); t.Wait(); } }