IsMetaFileOpenForEdit
Checks whether the.meta file of an asset object is open for editing in version control.
Read time 2 minutesLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
IsMetaFileOpenForEdit(Object, StatusQueryOptions)
Checks whether the .meta file of an asset object is open for editing in version control.
public static bool IsMetaFileOpenForEdit(Object assetObject, StatusQueryOptions statusOptions)
Parameters
The asset object to check.
How to query the version control system. These options affect the speed and accuracy of the query. The default value is StatusQueryOptions.UseCachedIfPossible.
Returns
Type | Description |
|---|---|
| bool | True if the version control system considers the .meta file open for editing. Otherwise, false. |
Remarks
Some version control systems only let one user at a time edit certain types of file, to avoid conflicts. In that case, you must open the file for editing, also known as checking it out, before you can edit it. Use this method to check whether the .meta file of an asset is open for editing. To check the asset file, use AssetDatabase.IsOpenForEdit.
IsMetaFileOpenForEdit(Object, string, StatusQueryOptions)
Checks whether the .meta file of an asset object is open for editing in version control and gets the reason if it isn't.
public static bool IsMetaFileOpenForEdit(Object assetObject, out string message, StatusQueryOptions statusOptions)
Parameters
The asset object to check.
When the method returns, contains the reason why the asset isn't available for editing, if there is one.
How to query the version control system. These options affect the speed and accuracy of the query. The default value is StatusQueryOptions.UseCachedIfPossible.
Returns
Type | Description |
|---|---|
| bool | True if the version control system considers the .meta file open for editing. Otherwise, false. |
Remarks
Some version control systems only let one user at a time edit certain types of file, to avoid conflicts. In that case, you must open the file for editing, also known as checking it out, before you can edit it. Use this method to check whether the .meta file of an asset is open for editing. To check the asset file, use AssetDatabase.IsOpenForEdit.