1
0
mirror of https://github.com/Siccity/xNode.git synced 2026-03-26 22:49:02 +08:00

!W 绘制不可被unity序列化的类型端口

This commit is contained in:
Icarus 2019-09-24 13:50:04 +08:00
parent 354f7d10d8
commit 38df17b58b

View File

@ -52,10 +52,28 @@ namespace XNodeEditor {
SerializedProperty iterator = serializedObject.GetIterator(); SerializedProperty iterator = serializedObject.GetIterator();
bool enterChildren = true; bool enterChildren = true;
EditorGUIUtility.labelWidth = 84; EditorGUIUtility.labelWidth = 84;
List<string> _names = new List<string>();
while (iterator.NextVisible(enterChildren)) { while (iterator.NextVisible(enterChildren)) {
enterChildren = false; enterChildren = false;
if (excludes.Contains(iterator.name)) continue; if (excludes.Contains(iterator.name)) continue;
NodeEditorGUILayout.PropertyField(iterator, true); NodeEditorGUILayout.PropertyField(iterator, true);
_names.Add(iterator.name);
}
//处理一下没被绘制的端口
foreach (var port in target.Ports)
{
//动态的跳过
if (port.IsDynamic)
{
continue;
}
//不受unity序列化支持,但是被标记为了输入或输出
if (!_names.Contains(port.fieldName))
{
NodeEditorGUILayout.PortField(port);
}
} }
#endif #endif