From e0d93c689c5223afaa7619975244fdc540ff58b9 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 20 Aug 2021 09:28:49 +0800 Subject: *misc --- Assets/ActionTool/Editor/ActionColliderEditor.cs | 58 +++++++++++++++++++++++- 1 file changed, 56 insertions(+), 2 deletions(-) (limited to 'Assets/ActionTool/Editor/ActionColliderEditor.cs') 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; -- cgit v1.1-26-g67d0