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

参数

assetObject 一个代表要查询其状态的资源的对象。
assetOrMetaFilePath 资源文件或其 .meta 文件在磁盘上的路径,此路径是相对于项目文件夹的路径。
message 返回资源未打开以供编辑的原因。
StatusQueryOptions 用于应如何查询版本控制系统的选项。这些选项会影响查询的速度以及准确性。

返回

bool 如果选定的版本控制系统认为资源已打开以供编辑,则为 true。

描述

查询资源文件是否在版本控制中打开以供编辑。

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