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