Documentation

Unity Engine

Unity Engine

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

This is called by Unity when inspecting assets to determine if an editor should be disabled.
Read time 1 minuteLast updated 5 days ago

Definition

IsOpenForEdit()

public void IsOpenForEdit(string[] assetOrMetaFilePaths, List<string> outNotEditablePaths, StatusQueryOptions statusQueryOptions)

Parameters

assetOrMetaFilePaths

Paths to Assets or their .meta files, relative to the project folder.

outNotEditablePaths

List<string>
Destination list of non-editable Asset paths.

statusQueryOptions

Specifies how Unity should query the version control system. The default value is StatusQueryOptions.UseCachedIfPossible.

Remarks

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. Additional Resources: AssetDatabase.IsOpenForEdit, StatusQueryOptions.

Examples

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; }}