文档

Unity Engine

Unity Engine

GetLatest

Starts a task that gets the latest version of a list of assets from the version control server.
阅读时间1 分钟最后更新于 11 天前

Definition

GetLatest(AssetList)

Starts a task that gets the latest version of a list of assets from the version control server.
public static Task GetLatest(AssetList assets)

Parameters

assets

The list of assets to update.

Returns

Type

Description

TaskThe task that gets the latest version of the assets.

Remarks

This task doesn't resolve file conflicts. To resolve conflicts, use Provider.Resolve as well.

Examples

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

GetLatest(Asset)

Starts a task that gets the latest version of a single asset from the version control server.
public static Task GetLatest(Asset asset)

Parameters

asset

The asset to update.

Returns

Type

Description

TaskThe task that gets the latest version of the asset.

Remarks

This task doesn't resolve file conflicts. To resolve conflicts, use Provider.Resolve as well.