Status
Starts a task that gets the latest version control status of a list of assets, including the contents of any folders.
阅读时间4 分钟最后更新于 11 天前
Definition
- Type: Method
- Namespace: UnityEditor.VersionControl
- Assembly: UnityEditor.CoreModule
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
The list of assets to get the status of.
Returns
Type | Description |
|---|---|
| Task | The 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 .
recursivelyusing 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 and its .meta file.
ExampleAsset.csStatus(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
The asset to get the status of.
Returns
Type | Description |
|---|---|
| Task | The 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 .
recursivelyStatus(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
Returns
Type | Description |
|---|---|
| Task | The 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
Returns
Type | Description |
|---|---|
| Task | The 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
The project-relative paths of the assets to get the status of.
Returns
Type | Description |
|---|---|
| Task | The 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 . Paths are relative to the project folder, for example .
recursivelyAssets/Example.csStatus(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
Returns
Type | Description |
|---|---|
| Task | The 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.csStatus(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
The project-relative path of the asset to get the status of.
Returns
Type | Description |
|---|---|
| Task | The 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 . Paths are relative to the project folder, for example .
recursivelyAssets/Example.csStatus(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
Returns
Type | Description |
|---|---|
| Task | The 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