GetLatest
Start a task for getting the latest version of an out of sync asset from the version control server.
Read time 1 minuteLast updated 9 days ago
Definition
- Type: Method
- Namespace: UnityEditor.VersionControl
- Assembly: UnityEditor.CoreModule
GetLatest(AssetList)
Start a task for getting the latest version of an out of sync asset from the version control server.
public static Task GetLatest(AssetList assets)
Parameters
List of assets to update.
Returns
Type | Description |
|---|---|
| Task |
Remarks
Note that the Provider.GetLatest task does not solve file conflicts, in such cases consider using the Provider.Resolve method 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)
Start a task for getting the latest version of an out of sync asset from the version control server.
public static Task GetLatest(Asset asset)
Parameters
Asset to update.
Returns
Type | Description |
|---|---|
| Task |
Remarks
Note that the Provider.GetLatest task does not solve file conflicts, in such cases consider using the Provider.Resolve method 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(); }}