private void OnImpactEffect(CharacterInfo target, string effectPath, string bonePath, float recycleTime) { if (null != target) { CharacterView view = EntityManager.Instance.GetCharacterViewById(target.GetId()); if (null != view) { GfxSystem.CreateAndAttachGameObject(effectPath, view.Actor, bonePath, recycleTime); } } }
protected override ExecResult ExecCommand(IInstance instance, long delta) { if (instance.Target is GameEntity obj) { string effectPath = m_EffectPath; uint resId = IdSystem.Instance.GenId(IdEnum.Resource); Quaternion quaternion = Quaternion.Euler(0, Mathf.Rad2Deg * obj.rotation.Value, 0); if (string.IsNullOrEmpty(m_AttachPath)) { GfxSystem.CreateGameObject(resId, effectPath, obj.position.Value + quaternion * m_Pos, m_Euler + new Vector3(0, Mathf.Rad2Deg * obj.rotation.Value, 0), m_Scale, m_DeleteTime); } else { GfxSystem.CreateAndAttachGameObject(resId, effectPath, obj.resource.Value, m_AttachPath, m_IsAttach, quaternion * m_Pos, m_Euler, m_Scale, m_DeleteTime); } } return(ExecResult.Finished); }