using System.Collections; using System.Collections.Generic; using UnityEngine; public partial class Avatar : MonoBehaviour, IInteractable { void ApplyHit(HitDefination hit) { if(hit.hurtAddForce.magnitude != 0) { m_Body.AddForce(hit.hurtAddForce); } // 切换到受击状态 switch(hit.type) { case HitType.Light: m_StateController.SwitchToState(m_StateLightHurt); break; case HitType.Midium: m_StateController.SwitchToState(m_StateMidiumHurt); break; case HitType.Heavy: m_StateController.SwitchToState(m_StateHeavyHurt); break; case HitType.Ground: m_StateController.SwitchToState(m_StateGroundHurt); break; case HitType.Air: m_StateController.SwitchToState(m_StateAirHurt); break; default: m_StateController.SwitchToState(m_StateLightHurt); break; } // spark if(hit.sparkName != string.Empty) { if(hit.sparkHostType == HitSparkHost.Center) { SparksManager.Instance.PlaySpark(hit.sparkName, m_Hips); } } } }