Checkout
Starts a task that checks out a list of assets into the default changeset.
阅读时间8 分钟最后更新于 11 天前
Definition
- Type: Method
- Namespace: UnityEditor.VersionControl
- Assembly: UnityEditor.CoreModule
Checkout(AssetList, CheckoutMode)
Starts a task that checks out a list of assets into the default changeset.
public static Task Checkout(AssetList assets, CheckoutMode mode)
Parameters
The list of assets to check out.
Whether to check out the asset file, its .meta file, or both. For more information, refer to CheckoutMode.
Returns
Type | Description |
|---|---|
| Task | The task that checks out the assets. |
Remarks
Some version control systems, such as Perforce and Unity Version Control, require you to check out an asset before you can edit it. This overload checks out into the default changeset. To choose a changeset, use the overload that takes a ChangeSet.
Checkout(AssetList, CheckoutMode, ChangeSet)
Starts a task that checks out a list of assets into a specified changeset.
public static Task Checkout(AssetList assets, CheckoutMode mode, ChangeSet changeset)
Parameters
The list of assets to check out.
Whether to check out the asset file, its .meta file, or both. For more information, refer to CheckoutMode.
The changeset to check the assets out into.
Returns
Type | Description |
|---|---|
| Task | The task that checks out the assets. |
Remarks
Some version control systems, such as Perforce and Unity Version Control, require you to check out an asset before you can edit it.
using System.Collections.Generic;using UnityEditor;using UnityEditor.VersionControl;using UnityEngine;public class EditorScript : MonoBehaviour{ [MenuItem("Version Control/Checkout")] public static void ExampleCheckout() { AssetList assets = new AssetList(); assets.Add(Provider.GetAssetByPath("Assets/ExampleAsset.cs")); ChangeSet changeset = new ChangeSet("Description", "1111"); Task t = Provider.Checkout(assets, CheckoutMode.Both, changeset); t.Wait(); }}
This example checks out and its .meta file into the changeset with the ID .
ExampleAsset.cs1111Checkout(string[], CheckoutMode)
Starts a task that checks out the assets at a list of project paths into the default changeset.
public static Task Checkout(string[] assets, CheckoutMode mode)
Parameters
The project-relative paths of the assets to check out.
Whether to check out the asset file, its .meta file, or both. For more information, refer to CheckoutMode.
Returns
Type | Description |
|---|---|
| Task | The task that checks out the assets. |
Remarks
Some version control systems, such as Perforce and Unity Version Control, require you to check out an asset before you can edit it. This overload checks out into the default changeset. To choose a changeset, use the overload that takes a ChangeSet. Paths are relative to the project folder, for example .
Assets/Example.csCheckout(string[], CheckoutMode, ChangeSet)
Starts a task that checks out the assets at a list of project paths into a specified changeset.
public static Task Checkout(string[] assets, CheckoutMode mode, ChangeSet changeset)
Parameters
The project-relative paths of the assets to check out.
Whether to check out the asset file, its .meta file, or both. For more information, refer to CheckoutMode.
The changeset to check the assets out into.
Returns
Type | Description |
|---|---|
| Task | The task that checks out the assets. |
Remarks
Some version control systems, such as Perforce and Unity Version Control, require you to check out an asset before you can edit it. Paths are relative to the project folder, for example .
Assets/Example.csCheckout(Object[], CheckoutMode)
Starts a task that checks out the assets of a list of Unity objects into the default changeset.
public static Task Checkout(Object[] assets, CheckoutMode mode)
Parameters
The Unity objects whose assets to check out.
Whether to check out the asset file, its .meta file, or both. For more information, refer to CheckoutMode.
Returns
Type | Description |
|---|---|
| Task | The task that checks out the assets. |
Remarks
Some version control systems, such as Perforce and Unity Version Control, require you to check out an asset before you can edit it. This overload checks out into the default changeset. To choose a changeset, use the overload that takes a ChangeSet. Unity looks up the asset path of each object with AssetDatabase.GetAssetPath.
Checkout(Object[], CheckoutMode, ChangeSet)
Starts a task that checks out the assets of a list of Unity objects into a specified changeset.
public static Task Checkout(Object[] assets, CheckoutMode mode, ChangeSet changeset)
Parameters
The Unity objects whose assets to check out.
Whether to check out the asset file, its .meta file, or both. For more information, refer to CheckoutMode.
The changeset to check the assets out into.
Returns
Type | Description |
|---|---|
| Task | The task that checks out the assets. |
Remarks
Some version control systems, such as Perforce and Unity Version Control, require you to check out an asset before you can edit it. Unity looks up the asset path of each object with AssetDatabase.GetAssetPath.
Checkout(Asset, CheckoutMode)
Starts a task that checks out a single asset into the default changeset.
public static Task Checkout(Asset asset, CheckoutMode mode)
Parameters
The asset to check out.
Whether to check out the asset file, its .meta file, or both. For more information, refer to CheckoutMode.
Returns
Type | Description |
|---|---|
| Task | The task that checks out the asset. |
Remarks
Some version control systems, such as Perforce and Unity Version Control, require you to check out an asset before you can edit it. This overload checks out into the default changeset. To choose a changeset, use the overload that takes a ChangeSet.
Checkout(Asset, CheckoutMode, ChangeSet)
Starts a task that checks out a single asset into a specified changeset.
public static Task Checkout(Asset asset, CheckoutMode mode, ChangeSet changeset)
Parameters
The asset to check out.
Whether to check out the asset file, its .meta file, or both. For more information, refer to CheckoutMode.
The changeset to check the asset out into.
Returns
Type | Description |
|---|---|
| Task | The task that checks out the asset. |
Remarks
Some version control systems, such as Perforce and Unity Version Control, require you to check out an asset before you can edit it.
Checkout(string, CheckoutMode)
Starts a task that checks out the asset at a project path into the default changeset.
public static Task Checkout(string asset, CheckoutMode mode)
Parameters
The project-relative path of the asset to check out.
Whether to check out the asset file, its .meta file, or both. For more information, refer to CheckoutMode.
Returns
Type | Description |
|---|---|
| Task | The task that checks out the asset. |
Remarks
Some version control systems, such as Perforce and Unity Version Control, require you to check out an asset before you can edit it. This overload checks out into the default changeset. To choose a changeset, use the overload that takes a ChangeSet. Paths are relative to the project folder, for example .
Assets/Example.csCheckout(string, CheckoutMode, ChangeSet)
Starts a task that checks out the asset at a project path into a specified changeset.
public static Task Checkout(string asset, CheckoutMode mode, ChangeSet changeset)
Parameters
The project-relative path of the asset to check out.
Whether to check out the asset file, its .meta file, or both. For more information, refer to CheckoutMode.
The changeset to check the asset out into.
Returns
Type | Description |
|---|---|
| Task | The task that checks out the asset. |
Remarks
Some version control systems, such as Perforce and Unity Version Control, require you to check out an asset before you can edit it. Paths are relative to the project folder, for example .
Assets/Example.csCheckout(Object, CheckoutMode)
Starts a task that checks out the asset of a Unity object into the default changeset.
public static Task Checkout(Object asset, CheckoutMode mode)
Parameters
The Unity object whose asset to check out.
Whether to check out the asset file, its .meta file, or both. For more information, refer to CheckoutMode.
Returns
Type | Description |
|---|---|
| Task | The task that checks out the asset. |
Remarks
Some version control systems, such as Perforce and Unity Version Control, require you to check out an asset before you can edit it. This overload checks out into the default changeset. To choose a changeset, use the overload that takes a ChangeSet. Unity looks up the asset path of each object with AssetDatabase.GetAssetPath.
Checkout(Object, CheckoutMode, ChangeSet)
Starts a task that checks out the asset of a Unity object into a specified changeset.
public static Task Checkout(Object asset, CheckoutMode mode, ChangeSet changeset)
Parameters
The Unity object whose asset to check out.
Whether to check out the asset file, its .meta file, or both. For more information, refer to CheckoutMode.
The changeset to check the asset out into.
Returns
Type | Description |
|---|---|
| Task | The task that checks out the asset. |
Remarks
Some version control systems, such as Perforce and Unity Version Control, require you to check out an asset before you can edit it. Unity looks up the asset path of each object with AssetDatabase.GetAssetPath.