summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Avatar/Avatar_Hurt.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-11-16 08:30:54 +0800
committerchai <chaifix@163.com>2020-11-16 08:30:54 +0800
commitf325841eff10ae492ce6c634d4b07cf058a068c6 (patch)
tree980d81a4b87d571fcb893fc44f8809af97466bca /Assets/Scripts/Avatar/Avatar_Hurt.cs
parentbe3ca8b172f22ce7c4c4316745e0df05de58b069 (diff)
*state system
Diffstat (limited to 'Assets/Scripts/Avatar/Avatar_Hurt.cs')
-rw-r--r--Assets/Scripts/Avatar/Avatar_Hurt.cs16
1 files changed, 13 insertions, 3 deletions
diff --git a/Assets/Scripts/Avatar/Avatar_Hurt.cs b/Assets/Scripts/Avatar/Avatar_Hurt.cs
index 3f26bcbe..f82ffbb6 100644
--- a/Assets/Scripts/Avatar/Avatar_Hurt.cs
+++ b/Assets/Scripts/Avatar/Avatar_Hurt.cs
@@ -11,9 +11,19 @@ public partial class Avatar : MonoBehaviour, IInteractable
m_Body.AddForce(hit.hurtAddForce);
}
- // force switch to hurt ability
+ // 切换到受击状态
+ switch(hit.type)
+ {
+ case HitType.Light: m_StateSystem.SwitchToState(m_StateLightHurt); break;
+ case HitType.Midium: m_StateSystem.SwitchToState(m_StateMidiumHurt); break;
+ case HitType.Heavy: m_StateSystem.SwitchToState(m_StateHeavyHurt); break;
+ case HitType.Ground: m_StateSystem.SwitchToState(m_StateGroundHurt); break;
+ case HitType.Air: m_StateSystem.SwitchToState(m_StateAirHurt); break;
+ default:
+ m_StateSystem.SwitchToState(m_StateLightHurt);
+ break;
+ }
-
- }
+ }
}