summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-08-23 22:27:25 +0800
committerchai <chaifix@163.com>2021-08-23 22:27:25 +0800
commitbc9c236dff63e8cce202eaa00b52d0743b0316f7 (patch)
tree3d5f089d7de95cc9dcd956453eaee9f06ec5aca0
parent3a71eb54456519256f573a6542b46f9c29443b22 (diff)
*misc
-rw-r--r--Assets/ActionTool/Editor/ActionColliderEditor.cs50
-rw-r--r--Assets/Scripts/Unit/Collider/ColliderBox_Hitbox.cs22
2 files changed, 46 insertions, 26 deletions
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))
diff --git a/Assets/Scripts/Unit/Collider/ColliderBox_Hitbox.cs b/Assets/Scripts/Unit/Collider/ColliderBox_Hitbox.cs
index 72bca7f8..ea95a0ed 100644
--- a/Assets/Scripts/Unit/Collider/ColliderBox_Hitbox.cs
+++ b/Assets/Scripts/Unit/Collider/ColliderBox_Hitbox.cs
@@ -26,6 +26,8 @@ public partial class ColliderBox
CenterOfIntersection = 0, // hitbox和hurtbox相交的矩形中心
CenterOfOther = 1, // 被攻击的对象的几何中心
PositionOfOther = 2, // 被攻击对象的原点
+ CenterOfHitbox = 3, // hitbox的中心
+ FrontOfHitbox = 4, // hitbox的前方
}
public enum EMeshEffect : int
@@ -48,15 +50,29 @@ public partial class ColliderBox
[Tooltip("对方顿帧")]
public float freezeFramesOther;
- [Foldout("粒子效果", 3)]
+ [Foldout("粒子效果", 10)]
[Tooltip("击中后的粒子效果")]
public string sparkPath;
[Tooltip("粒子的锚点")]
public ESparkAnchor sparkAnchor;
[Tooltip("击中后的粒子位置偏移")]
public Vector3 sparkOffset;
-
- [Foldout("网格效果", 2)]
+ [Tooltip("多个粒子,最多支持3个")]
+ public bool multiSparks;
+ [If("multiSparks"), Tooltip("击中后的粒子效果")]
+ public string spark2Path;
+ [If("multiSparks"), Tooltip("粒子的锚点")]
+ public ESparkAnchor spark2Anchor;
+ [If("multiSparks"), Tooltip("击中后的粒子位置偏移")]
+ public Vector3 spark2Offset;
+ [If("multiSparks"), Tooltip("击中后的粒子效果")]
+ public string spark3Path;
+ [If("multiSparks"), Tooltip("粒子的锚点")]
+ public ESparkAnchor spark3Anchor;
+ [If("multiSparks"), Tooltip("击中后的粒子位置偏移")]
+ public Vector3 spark3Offset;
+
+ [Foldout("网格效果", 2)]
public EMeshEffect selfEffect;
public EMeshEffect otherEffect;