Legacy Documentation: Version 2017.2 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

AssetDatabase.IsOpenForEdit

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static method IsOpenForEdit(assetObject: Object, StatusQueryOptions: StatusQueryOptions): bool;
public static bool IsOpenForEdit(Object assetObject, StatusQueryOptions StatusQueryOptions);
public static method IsOpenForEdit(assetOrMetaFilePath: string, StatusQueryOptions: StatusQueryOptions): bool;
public static bool IsOpenForEdit(string assetOrMetaFilePath, StatusQueryOptions StatusQueryOptions);
public static method IsOpenForEdit(assetObject: Object, out message: string, statusOptions: StatusQueryOptions): bool;
public static bool IsOpenForEdit(Object assetObject, out string message, StatusQueryOptions statusOptions);
public static method IsOpenForEdit(assetOrMetaFilePath: string, out message: string, statusOptions: StatusQueryOptions): bool;
public static bool IsOpenForEdit(string assetOrMetaFilePath, out string message, StatusQueryOptions statusOptions);
Obsolete public static method IsOpenForEdit(assetObject: Object): bool;
Obsolete public static bool IsOpenForEdit(Object assetObject);
Obsolete public static method IsOpenForEdit(assetOrMetaFilePath: string): bool;
Obsolete public static bool IsOpenForEdit(string assetOrMetaFilePath);
Obsolete public static method IsOpenForEdit(assetObject: Object, out message: string): bool;
Obsolete public static bool IsOpenForEdit(Object assetObject, out string message);
Obsolete public static method IsOpenForEdit(assetOrMetaFilePath: string, out message: string): bool;
Obsolete public static bool IsOpenForEdit(string assetOrMetaFilePath, out string message);

Parameters

assetObject Object representing the asset whose status you wish to query.
assetOrMetaFilePath Path to the asset file or its .meta file on disk, relative to project folder.
message Returns a reason for the asset not being open for edit.
StatusQueryOptions Options for how the version control system should be queried. These options can effect the speed and accuracy of the query.

Returns

bool True if the asset is considered open for edit by the selected version control system.

Description

Query whether an asset file is open for edit in version control.

Your version control system may be configured to only allow a single user at a time to edit certain types of file, to avoid conflicts that arise when multiple users edit a file at the same time.
In this case a user must 'open' that file for editing (also known as 'checking out') to ensure that they have permission to edit the file.
Use this function to query the 'open for edit' status of a file in a version control system that supports it.
See Also: AssetDatabase.IsMetaFileOpenForEdit
See Also: StatusQueryOptions

Did you find this page useful? Please give it a rating: