浏览代码

Callable Name in dropdown

/main
Thomas ICHÉ 6 年前
当前提交
f850789d
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. 9
      Editor/PropertyDrawers/CallablePropertyDrawer.cs

9
Editor/PropertyDrawers/CallablePropertyDrawer.cs


namespace GameplayIngredients.Editor
{
[CustomPropertyDrawer(typeof(Callable))]
public class CallablePropertyDrawer : PropertyDrawer
{

}
var pickRect = new Rect(position);
pickRect.xMin = pickRect.xMax - 84;
pickRect.xMin = pickRect.xMax - 184;
pickRect.xMax -= 30;
var gotoRect = new Rect(position);

objRect.xMax -= 88;
objRect.xMax -= 188;
var obj = EditorGUI.ObjectField(objRect, property.objectReferenceValue, typeof(Callable), true);

{
Selection.activeObject = property.objectReferenceValue;
}
if (GUI.Button(pickRect, "Select"))
if (GUI.Button(pickRect, (property.objectReferenceValue as Callable).Name, EditorStyles.popup))
{
ShowMenu(property);
}

正在加载...
取消
保存