コード例 #1
0
 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);
         }
     }
 }
コード例 #2
0
ファイル: EffectCommand.cs プロジェクト: af3dgce/EntitasUnity
        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);
        }