From ac2b469bd76d7d91d10894184cbddad0796ce7bc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 16 Nov 2020 14:38:55 +0800 Subject: *statecontroller --- Assets/Scripts/Avatar/Avatar.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Assets/Scripts/Avatar/Avatar.cs') diff --git a/Assets/Scripts/Avatar/Avatar.cs b/Assets/Scripts/Avatar/Avatar.cs index 601fafab..0ee7555f 100644 --- a/Assets/Scripts/Avatar/Avatar.cs +++ b/Assets/Scripts/Avatar/Avatar.cs @@ -16,7 +16,7 @@ public partial class Avatar : MonoBehaviour, IInteractable public Hitbox[] m_Hitbox; public Hurtbox[] m_Hurtbox; - protected StateSystem m_StateSystem = new StateSystem(); + protected StateController m_StateController = new StateController(); // 预定义的state,角色必须定义的 protected StateBase m_StateLightHurt; @@ -84,13 +84,13 @@ public partial class Avatar : MonoBehaviour, IInteractable public void OnUpdate() { - m_StateSystem.OnUpdate(); + m_StateController.OnUpdate(); } // 在物理模拟之后调用 public void OnPhysicsUpdate() { - m_StateSystem.OnPhysicsUpdate(); + m_StateController.OnPhysicsUpdate(); } public virtual Vector3 GetEffectPosition() @@ -101,13 +101,13 @@ public partial class Avatar : MonoBehaviour, IInteractable // 获得当前击打如果有的话 public Hit GetHit() { - return m_StateSystem.GetHit(); + return m_StateController.GetHit(); } public virtual void OnHit(HitInfo hitInfo) { //Debug.Log("Hit"); - m_StateSystem.OnHit(hitInfo); + m_StateController.OnHit(hitInfo); } public virtual void OnHurt(HurtInfo hurtInfo) @@ -116,7 +116,7 @@ public partial class Avatar : MonoBehaviour, IInteractable HitDefination hitDef = hurtInfo.hitDef; if (hitDef != null) ApplyHit(hitDef); - m_StateSystem.OnHurt(hurtInfo); + m_StateController.OnHurt(hurtInfo); } -- cgit v1.1-26-g67d0