diff options
author | chai <chaifix@163.com> | 2021-08-20 09:28:49 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-08-20 09:28:49 +0800 |
commit | e0d93c689c5223afaa7619975244fdc540ff58b9 (patch) | |
tree | 44fd8b8ec1a73844fde58250dcdae556e84c64a4 /Assets/ActionTool/Editor/ActionColliderEditor.cs | |
parent | f50326c223546e862f6800f643490e13616960e0 (diff) |
*misc
Diffstat (limited to 'Assets/ActionTool/Editor/ActionColliderEditor.cs')
-rw-r--r-- | Assets/ActionTool/Editor/ActionColliderEditor.cs | 58 |
1 files changed, 56 insertions, 2 deletions
diff --git a/Assets/ActionTool/Editor/ActionColliderEditor.cs b/Assets/ActionTool/Editor/ActionColliderEditor.cs index 85e29c6d..78cd65d6 100644 --- a/Assets/ActionTool/Editor/ActionColliderEditor.cs +++ b/Assets/ActionTool/Editor/ActionColliderEditor.cs @@ -109,8 +109,62 @@ namespace ActionTool break;
}
}
- }
- if(skip)
+ else if (attr.GetType() == typeof(WhenAttribute))
+ {
+ WhenAttribute when = attr as WhenAttribute;
+ string conditionName = when.conditionName;
+ FieldInfo condition = type.GetField(conditionName);
+ if ((int)condition.GetValue(collider) != when.value)
+ {
+ skip = true;
+ break;
+ }
+ }
+ else if (attr.GetType() == typeof(WhenNotAttribute))
+ {
+ WhenNotAttribute when = attr as WhenNotAttribute;
+ string conditionName = when.conditionName;
+ FieldInfo condition = type.GetField(conditionName);
+ if ((int)condition.GetValue(collider) == when.value)
+ {
+ skip = true;
+ break;
+ }
+ }
+ else if(attr.GetType() == typeof(IfAttribute))
+ {
+ IfAttribute when = attr as IfAttribute;
+ string conditionName = when.conditionName;
+ FieldInfo condition = type.GetField(conditionName);
+ if (!(bool)condition.GetValue(collider))
+ {
+ skip = true;
+ break;
+ }
+ }
+ else if (attr.GetType() == typeof(IfNotAttribute))
+ {
+ IfNotAttribute when = attr as IfNotAttribute;
+ string conditionName = when.conditionName;
+ FieldInfo condition = type.GetField(conditionName);
+ if ((bool)condition.GetValue(collider))
+ {
+ skip = true;
+ 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);
+ }
+ }
+ if (skip)
{
GUI.enabled = true;
continue;
|