summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Unit/Collider/ColliderBox_Hitbox.cs
blob: 9f1d629aa3a5a2ce846a5ca02ba78750afb3ae79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
using UnityEngine;

// 打击感相关资料
// https://gameinstitute.qq.com/community/detail/112371
// 

public partial class ColliderBox
{

    public enum EColorDriftMode : int
	{
		None = 0,
		UI = 1,
		All = 2,
	}

	public enum EBlurMode : int
	{
		None = 0,
		Gauß = 1,
		Radial = 2,
	}

	public enum ESparkAnchor : int
	{
		CenterOfIntersection = 0, // hitbox和hurtbox相交的矩形中心
        CenterOfOther = 1, // 被攻击的对象的几何中心
        PositionOfOther = 2, // 被攻击对象的原点
		CenterOfHitbox = 3, // hitbox的中心
		FrontOfHitbox = 4, // hitbox的前方
	}

    public enum EMeshEffect : int
    {
        None = 0,
        White = 1,
        Red = 2,
    }

    // 击中反馈
    public enum EHitResponse
    {
        Light = 0, 
        Heavy = 1, 
        HitAir = 2, 
        HitGround = 3,
        HitInAir = 4,
    }

    [ColliderType(EColliderType.HitBox)]

	[Tooltip("允许多次击中")]
	public bool multiHit;

    public EHitResponse hitResponse;

    [Tooltip("击退距离")]
    public Vector3 hitBack;

    [Tooltip("击退曲线")]
    public AnimationCurve hitCurve;

    [Comment("[ 击中效果 ]", TextAnchor.MiddleCenter)]

    [Foldout("时间效果", 3)]
    [Tooltip("全局顿帧")]
    public float freezeGlobal;
    [Tooltip("自身顿帧")]
    public float freezeFramesSelf;
    //[WhenNot("freezeFramesSelf", 0)]
    //public AnimationCurve freezeFramesSelfCurve;
    [Tooltip("对方顿帧")]
    public float freezeFramesOther;
    //[WhenNot("freezeFramesOther", 0)]
    //public AnimationCurve freezeFramesOtherCurve;

    [Foldout("粒子效果", 10)]
    [Tooltip("击中后的粒子效果")]
	public string sparkPath;
	[Tooltip("粒子的锚点")]
	public ESparkAnchor sparkAnchor = ESparkAnchor.CenterOfOther;
	[Tooltip("击中后的粒子位置偏移")]
	public Vector3 sparkOffset;
	[Tooltip("击中后的粒子大小")]
	public Vector3 sparkScale = Vector3.one;
	[Tooltip("多个粒子,最多支持3个")]
	public bool multiSparks;
	[If("multiSparks"), Tooltip("击中后的粒子效果")]
	public string spark2Path;
	[If("multiSparks"), Tooltip("粒子的锚点")]
	public ESparkAnchor spark2Anchor = ESparkAnchor.CenterOfOther;
	[If("multiSparks"), Tooltip("击中后的粒子位置偏移")]
	public Vector3 spark2Offset;
	[If("multiSparks"), Tooltip("击中后的粒子效果")]
	public string spark3Path;
	[If("multiSparks"), Tooltip("粒子的锚点")]
	public ESparkAnchor spark3Anchor = ESparkAnchor.CenterOfOther;
	[If("multiSparks"), Tooltip("击中后的粒子位置偏移")]
	public Vector3 spark3Offset;

	[Foldout("网格效果", 2)]
    public EMeshEffect selfEffect;
    public EMeshEffect otherEffect;

    [Foldout("相机效果", 4)]
	[Tooltip("拉近相机")]
	public bool zoomCamera;
    [Tooltip("是否震屏")]
	public bool shakeScreen;
	[If("shakeScreen"), Tooltip("是否震屏")]
	public Vector2 shakeOffset;
	[If("shakeScreen"), Tooltip("震屏力度")]
	public float shakeStrength;

    [Foldout("屏幕效果", 2)]
    [Tooltip("颜色漂移效果")]
    public EColorDriftMode colorDrift;
	public EBlurMode blur;

	[Foldout("音效", 1)]
	[Tooltip("音效")]
	public string soundPath;

}