AssetModificationProcessor.IsOpenForEdit(string[],List<string>,StatusQueryOptions)

Cambiar al Manual

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.

Valor de retorno

void Returns true if all files are editable.

Descripción

This is called by Unity when inspecting assets to determine if an editor should be disabled.

Although this is called by Unity's own systems, you can also call it if you are implementing your own Editor tools such as a custom version control integration.

See Also: AssetDatabase.IsOpenForEdit, StatusQueryOptions.

using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

class CustomAssetModificationProcessor : UnityEditor.AssetModificationProcessor { static bool IsOpenForEdit(string[] paths, List<string> outNotEditablePaths, StatusQueryOptions statusQueryOptions) { Debug.Log("IsOpenForEdit:"); foreach (var path in paths) Debug.Log(path); return true; } }

Parámetros

assetOrMetaFilePathPath to the asset file or its .meta file on disk, relative to project folder.
messageReturns a reason for the asset not being open for edit.

Valor de retorno

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

Descripción

This is called by Unity when inspecting an asset to determine if an editor should be disabled.

Although this is called by Unity's own systems, you can also call it if you are implementing your own Editor tools such as a custom version control integration. Consider using method overload that accepts an array of file paths to improve version control system performance.