浏览代码

Handle Nulls in Callable property drawers

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

11
Editor/PropertyDrawers/CallablePropertyDrawer.cs


setNextObjectValue = null;
}
if(property.objectReferenceValue == null)
{
GUI.backgroundColor = Color.red;
EditorGUI.DrawRect(position, new Color(1.0f,0,0,0.25f));
}
var pickRect = new Rect(position);
pickRect.xMin = pickRect.xMax - 184;
pickRect.xMax -= 30;

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

GUI.Label(pickRect, "No Callable Selected", EditorStyles.popup);
EditorGUI.EndDisabledGroup();
}
GUI.backgroundColor = Color.white;
}
void ShowMenu(SerializedProperty property)

正在加载...
取消
保存