CanOpenForEdit(string[], List<string>, StatusQueryOptions)
This is called by Unity when inspecting assets to determine if they can potentially be opened for editing.
Read time 1 minuteLast updated 5 days ago
Definition
- Type: Method
- Namespace: UnityEditor
CanOpenForEdit()
public void CanOpenForEdit(string[] assetOrMetaFilePaths, List<string> outNotEditablePaths, StatusQueryOptions statusQueryOptions)
Parameters
Paths to Assets or their .meta files, relative to the project folder.
Specifies how Unity should query the version control system. The default value is StatusQueryOptions.UseCachedIfPossible.
Remarks
This is called by Unity's own systems, but you can also call it if you are implementing your own Editor tools such as a custom version control integration. Additional Resources: AssetDatabase.CanOpenForEdit, StatusQueryOptions.
Examples
using System.Collections.Generic;using UnityEditor;using UnityEngine;class CustomAssetModificationProcessor : UnityEditor.AssetModificationProcessor{ static bool CanOpenForEdit(string[] paths, List<string> outNotEditablePaths, StatusQueryOptions statusQueryOptions) { Debug.Log("CanOpenForEdit:"); foreach (var path in paths) Debug.Log(path); return true; }}