From f7e60ab9a52e557aa2250477d018b2768bccc028 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 1 Sep 2021 20:48:18 +0800 Subject: *misc --- Assets/ActionTool/Editor/ActionEventEditor.cs | 162 ++++++++++++++++---------- 1 file changed, 103 insertions(+), 59 deletions(-) (limited to 'Assets/ActionTool/Editor/ActionEventEditor.cs') diff --git a/Assets/ActionTool/Editor/ActionEventEditor.cs b/Assets/ActionTool/Editor/ActionEventEditor.cs index a2aefbf6..50b697e4 100644 --- a/Assets/ActionTool/Editor/ActionEventEditor.cs +++ b/Assets/ActionTool/Editor/ActionEventEditor.cs @@ -102,65 +102,109 @@ namespace ActionTool { tooltip = tooltipattr.tooltip; } - else if (attr.GetType() == typeof(DisallowModifiyInGUI)) - { - GUI.enabled = false; - } - else if (attr.GetType() == typeof(WhenAttribute)) - { - WhenAttribute when = attr as WhenAttribute; - string conditionName = when.conditionName; - FieldInfo condition = type.GetField(conditionName); - if ((int)condition.GetValue(animEvent) != 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(animEvent) == 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(animEvent)) - { - 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(animEvent)) - { - 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); - } - } + } + else if (attr.GetType() == typeof(DisallowModifiyInGUI)) + { + GUI.enabled = false; + } + else if (attr.GetType() == typeof(WhenAttribute)) + { + WhenAttribute when = attr as WhenAttribute; + string conditionName = when.conditionName; + FieldInfo condition = type.GetField(conditionName); + if ((int)condition.GetValue(animEvent) != 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(animEvent) == 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(animEvent)) + { + 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(animEvent)) + { + 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); + } + else if (attr.GetType() == typeof(WhenAttribute)) + { + WhenAttribute when = attr as WhenAttribute; + string conditionName = when.conditionName; + FieldInfo condition = type.GetField(conditionName); + if ((float)condition.GetValue(animEvent) != 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 ((float)condition.GetValue(animEvent) == 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(animEvent)) + { + 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(animEvent)) + { + skip = true; + break; + } + } } if (skip) { -- cgit v1.1-26-g67d0