assets | The asset list to fetch state information for. |
asset | The asset to fetch state information for. |
recursively | 指定されているアセットがフォルダーの場合、このフラグは同様にフォルダーのすべての子孫のステータスを取得します。 |
Starts a task that will fetch the most recent status about the asset or assets from the revision control system.
The updated assets can be access through the task's assetList property once it has completed.
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())); } }
The example code above will check the status of the given example asset and its .meta file and output that information into the console.