diff options
Diffstat (limited to 'Assets/ActionTool/Editor/ActionColliderEditor.cs')
-rw-r--r-- | Assets/ActionTool/Editor/ActionColliderEditor.cs | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/Assets/ActionTool/Editor/ActionColliderEditor.cs b/Assets/ActionTool/Editor/ActionColliderEditor.cs index a446b61d..69f6a372 100644 --- a/Assets/ActionTool/Editor/ActionColliderEditor.cs +++ b/Assets/ActionTool/Editor/ActionColliderEditor.cs @@ -97,12 +97,23 @@ namespace ActionTool bool skip = false;
foreach (var attr in field.GetCustomAttributes())
{
- if(attr.GetType() == typeof(ColliderTypeAttribute))
+ if (attr.GetType() == typeof(ColliderTypeAttribute))
{
ColliderTypeAttribute t = attr as ColliderTypeAttribute;
collliderType = (int)t.type;
}
- else if (attr.GetType() == typeof(WhenAttribute))
+ }
+ if (collliderType != -1 && collliderType != (int)collider.type)
+ {
+ skip = true;
+ }
+ if (skip)
+ {
+ continue;
+ }
+ foreach (var attr in field.GetCustomAttributes())
+ {
+ if (attr.GetType() == typeof(WhenAttribute))
{
WhenAttribute when = attr as WhenAttribute;
string conditionName = when.conditionName;
@@ -158,10 +169,15 @@ namespace ActionTool indent = 13;
}
}
- }
- if (collliderType != -1 && collliderType != (int)collider.type)
- {
- skip = true;
+ else if (attr.GetType() == typeof(CommentAttribute))
+ {
+ CommentAttribute comment = attr as CommentAttribute;
+ GUIStyle style = GUI.skin.GetStyle("Label");
+ TextAnchor preanchor = style.alignment;
+ style.alignment = comment.alignment;
+ GUI_Label(new GUIContent(comment.comment), style);
+ style.alignment = preanchor;
+ }
}
if(foldout != null && (++foldoutElementCount) <= foldout.count)
{
@@ -198,12 +214,7 @@ namespace ActionTool 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);
|