Version: 2023.2

AssetModificationProcessor.MakeEditable(string[],string,List<string>)

切换到手册

参数

paths 指定相对于项目根目录的文件路径的数组。
prompt 要向用户显示的对话框提示(如果需要执行版本控制操作)。如果为 /null/(默认值),则不显示任何提示。
outNotEditablePaths 无法设为可编辑的文件路径的输出列表。

返回

void Returns true if all files have been made editable.

描述

Unity calls this method when one or more files need to be opened for editing.

It must be static if implemented.

Additional resources: AssetDatabase.MakeEditable.

using System.Collections.Generic;
using UnityEngine;

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