文档

Unity Engine

Unity Engine

GetLatestIsValid(AssetList)

The task tests the given asset list and returns true if Provider.GetLatest is valid operation for one or more assets.
阅读时间1 分钟最后更新于 11 天前

Definition

public static bool GetLatestIsValid(AssetList assets)

Parameters

assets

List of assets to test.

Returns

Type

Description

boolTrue if Provider.GetLatest is a valid operation for one or more of the given assets. Otherwise, false.

Examples

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