public static bool CanOpenForEdit (Object assetObject, StatusQueryOptions statusOptions= StatusQueryOptions.UseCachedIfPossible);
public static bool CanOpenForEdit (string assetOrMetaFilePath, StatusQueryOptions statusOptions= StatusQueryOptions.UseCachedIfPossible);
public static bool CanOpenForEdit (Object assetObject, out string message, StatusQueryOptions statusOptions= StatusQueryOptions.UseCachedIfPossible);
public static bool CanOpenForEdit (string assetOrMetaFilePath, out string message, StatusQueryOptions statusOptions= StatusQueryOptions.UseCachedIfPossible);

Parámetros

assetObjectObject representing the asset whose status you wish to query.
assetOrMetaFilePathPath to the asset file or its .meta file on disk, relative to project folder.
messageReturns a reason for the asset not being available for edit.
statusOptionsOptions for how the version control system should be queried. These options can effect the speed and accuracy of the query. Default is StatusQueryOptions.UseCachedIfPossible.

Valor de retorno

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

Descripción

Query whether an Asset file can be opened for editing in version control and is not exclusively locked by another user or otherwise unavailable.


public static void CanOpenForEdit (string[] assetOrMetaFilePaths, List<string> outNotEditablePaths, StatusQueryOptions statusQueryOptions= StatusQueryOptions.UseCachedIfPossible);

Parámetros

assetOrMetaFilePathsPaths to Assets or their .meta files, relative to the project folder.
outNotEditablePathsDestination list of non-editable Asset paths.
statusQueryOptionsSpecifies how Unity should query the version control system. The default value is StatusQueryOptions.UseCachedIfPossible.

Descripción

Query which of the provided Asset files can be opened for editing in version control and are not remotely locked or otherwise unavailable.

This variant of the CanOpenForEdit function can query multiple Asset paths at once. It writes paths for Assets that are not 'available for edit' into the outNotEditablePaths list.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961