Version: 2020.2
public static VersionControl.Task GetLatest (VersionControl.AssetList assets);
public static VersionControl.Task GetLatest (VersionControl.Asset asset);

参数

assets 要更新的资源列表。
asset 要更新的资源。

描述

Start a task for getting the latest version of an out of sync asset from the version control server.

Note that the Provider.GetLatest task does not solve file conflicts, in such cases consider using the Provider.Resolve method as well.

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

public class EditorScript : MonoBehaviour { [MenuItem("Version Control/GetLatest")] public static void ExampleGetLatest() { AssetList assets = new AssetList(); assets.Add(Provider.GetAssetByPath("Assets/ExampleAsset.cs")); Task t = Provider.GetLatest(assets); t.Wait(); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961