From bc9c236dff63e8cce202eaa00b52d0743b0316f7 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 23 Aug 2021 22:27:25 +0800 Subject: *misc --- Assets/ActionTool/Editor/ActionColliderEditor.cs | 50 +++++++++++++----------- 1 file changed, 27 insertions(+), 23 deletions(-) (limited to 'Assets/ActionTool/Editor/ActionColliderEditor.cs') diff --git a/Assets/ActionTool/Editor/ActionColliderEditor.cs b/Assets/ActionTool/Editor/ActionColliderEditor.cs index a883bd46..a446b61d 100644 --- a/Assets/ActionTool/Editor/ActionColliderEditor.cs +++ b/Assets/ActionTool/Editor/ActionColliderEditor.cs @@ -97,19 +97,7 @@ namespace ActionTool bool skip = false; foreach (var attr in field.GetCustomAttributes()) { - if (attr.GetType() == typeof(TooltipAttribute)) - { - TooltipAttribute tooltipattr = attr as TooltipAttribute; - if (tooltip != null) - { - tooltip = tooltipattr.tooltip; - } - } - else if(attr.GetType() == typeof(DisallowModifiyInGUI)) - { - GUI.enabled = false; - } - else if(attr.GetType() == typeof(ColliderTypeAttribute)) + if(attr.GetType() == typeof(ColliderTypeAttribute)) { ColliderTypeAttribute t = attr as ColliderTypeAttribute; collliderType = (int)t.type; @@ -158,16 +146,6 @@ namespace ActionTool break; } } - else if (attr.GetType() == typeof(SpaceAttribute)) - { - SpaceAttribute space = attr as SpaceAttribute; - GUILayout.Space(space.height); - } - else if (attr.GetType() == typeof(CommentAttribute)) - { - CommentAttribute comment = attr as CommentAttribute; - EditorGUILayout.LabelField(comment.comment); - } else if (attr.GetType() == typeof(FoldoutAttribute)) { if(collliderType == -1 || collliderType == (int)collider.type) @@ -201,6 +179,32 @@ namespace ActionTool continue; } + foreach (var attr in field.GetCustomAttributes()) + { + if (attr.GetType() == typeof(TooltipAttribute)) + { + TooltipAttribute tooltipattr = attr as TooltipAttribute; + if (tooltip != null) + { + tooltip = tooltipattr.tooltip; + } + } + else if (attr.GetType() == typeof(DisallowModifiyInGUI)) + { + GUI.enabled = false; + } + else if (attr.GetType() == typeof(SpaceAttribute)) + { + SpaceAttribute space = attr as SpaceAttribute; + GUILayout.Space(space.height); + } + else if (attr.GetType() == typeof(CommentAttribute)) + { + CommentAttribute comment = attr as CommentAttribute; + EditorGUILayout.LabelField(comment.comment); + } + } + GUI_Label(new GUIContent(name, tooltip), styles.textBold); if (field.FieldType == typeof(Vector3)) -- cgit v1.1-26-g67d0