Editor.CreateCachedEditor

切换到手册
public static void CreateCachedEditor (Object targetObject, Type editorType, ref Editor previousEditor);
public static void CreateCachedEditor (Object[] targetObjects, Type editorType, ref Editor previousEditor);

参数

obj编辑器正在跟踪的对象。
editorType请求的编辑器类型。对于该对象的默认编辑器,值为 null。
previousEditor该对象之前的编辑器。CreateCachedEditor 返回后,previousEditortargetObjecttargetObjects 的编辑器。
objects编辑器正在跟踪的多个对象。

描述

返回时,previousEditortargetObjecttargetObjects 的编辑器。如果该编辑器已在跟踪对象,则函数会返回,否则该函数会销毁之前的编辑器并创建一个新编辑器。

默认情况下,所选的相应编辑器具有匹配的 CustomEditor 属性。 如果已指定 editorType,则会创建该类型的编辑器。 如果您已创建多个自定义编辑器,其中每个编辑器显示该对象的不同属性,请使用此方法。 如果 objects 具有不同的类型或者未找到相应的编辑器,previousEditor 将为 NULL。