Documentation

Unity Engine

Unity Engine

Status

Starts a task that gets the latest version control status of a list of assets, including the contents of any folders.
Read time 4 minutesLast updated 11 days ago

Definition

Status(AssetList)

Starts a task that gets the latest version control status of a list of assets, including the contents of any folders.
public static Task Status(AssetList assets)

Parameters

assets

The list of assets to get the status of.

Returns

Type

Description

TaskThe task that gets the status of the assets.

Remarks

When the task completes, its Task.assetList contains the updated assets. This overload includes the contents of folders. To exclude them, use the overload that takes
recursively
.
using System.Collections.Generic;using UnityEditor;using UnityEditor.VersionControl;using UnityEngine;public class EditorScript : MonoBehaviour{ [MenuItem("Version Control/Status")] public static void ExampleStatus() { AssetList assets = new AssetList(); assets.Add(Provider.GetAssetByPath("Assets/ExampleAsset.cs")); Task t = Provider.Status(assets); t.Wait(); t.assetList.ForEach(asset => Debug.Log(asset.name + " " + asset.state.ToString())); }}
This example logs the name and version control state of
ExampleAsset.cs
and its .meta file.

Status(Asset)

Starts a task that gets the latest version control status of a single asset, including the contents of any folders.
public static Task Status(Asset asset)

Parameters

asset

The asset to get the status of.

Returns

Type

Description

TaskThe task that gets the status of the asset.

Remarks

When the task completes, its Task.assetList contains the updated assets. This overload includes the contents of folders. To exclude them, use the overload that takes
recursively
.

Status(AssetList, bool)

Starts a task that gets the latest version control status of a list of assets, with the option to include folder contents.
public static Task Status(AssetList assets, bool recursively)

Parameters

assets

The list of assets to get the status of.

recursively

Set to true to also get the status of everything inside any folders, recursively. Set to false to get the status of only the specified items.

Returns

Type

Description

TaskThe task that gets the status of the assets.

Remarks

When the task completes, its Task.assetList contains the updated assets.

Status(Asset, bool)

Starts a task that gets the latest version control status of a single asset, with the option to include folder contents.
public static Task Status(Asset asset, bool recursively)

Parameters

asset

The asset to get the status of.

recursively

Set to true to also get the status of everything inside any folders, recursively. Set to false to get the status of only the specified items.

Returns

Type

Description

TaskThe task that gets the status of the asset.

Remarks

When the task completes, its Task.assetList contains the updated assets.

Status(string[])

Starts a task that gets the latest version control status of the assets at a list of project paths, including the contents of any folders.
public static Task Status(string[] assets)

Parameters

assets

The project-relative paths of the assets to get the status of.

Returns

Type

Description

TaskThe task that gets the status of the assets.

Remarks

When the task completes, its Task.assetList contains the updated assets. This overload includes the contents of folders. To exclude them, use the overload that takes
recursively
. Paths are relative to the project folder, for example
Assets/Example.cs
.

Status(string[], bool)

Starts a task that gets the latest version control status of the assets at a list of project paths, with the option to include folder contents.
public static Task Status(string[] assets, bool recursively)

Parameters

assets

The project-relative paths of the assets to get the status of.

recursively

Set to true to also get the status of everything inside any folders, recursively. Set to false to get the status of only the specified items.

Returns

Type

Description

TaskThe task that gets the status of the assets.

Remarks

When the task completes, its Task.assetList contains the updated assets. Paths are relative to the project folder, for example
Assets/Example.cs
.

Status(string)

Starts a task that gets the latest version control status of the asset at a project path, including the contents of any folders.
public static Task Status(string asset)

Parameters

asset

The project-relative path of the asset to get the status of.

Returns

Type

Description

TaskThe task that gets the status of the asset.

Remarks

When the task completes, its Task.assetList contains the updated assets. This overload includes the contents of folders. To exclude them, use the overload that takes
recursively
. Paths are relative to the project folder, for example
Assets/Example.cs
.

Status(string, bool)

Starts a task that gets the latest version control status of the asset at a project path, with the option to include folder contents.
public static Task Status(string asset, bool recursively)

Parameters

asset

The project-relative path of the asset to get the status of.

recursively

Set to true to also get the status of everything inside any folders, recursively. Set to false to get the status of only the specified items.

Returns

Type

Description

TaskThe task that gets the status of the asset.

Remarks

When the task completes, its Task.assetList contains the updated assets. Paths are relative to the project folder, for example
Assets/Example.cs
.