Пример #1
0
        //释放技能
        public virtual void OnEntityReleaseSkill()
        {
            SkillManagerConfig skillManagerConfig = ConfigReader.GetSkillManagerCfg(EntitySkillID);

            if (skillManagerConfig == null)
            {
                return;
            }
            //吸附技能   实际上是配置文件中的  bIsConsumeSkill
            if (skillManagerConfig.isAbsorb == 1)
            {
                //删除已有的相同特效
                foreach (Transform child in RealEntity.objAttackPoint)
                {
                    if (child.name.Contains(skillManagerConfig.absorbRes))
                    {
                        int offset = child.name.IndexOf('_');
                        if (offset != 0)
                        {
                            string name = child.name.Substring(offset + 1);
                            int    id   = Convert.ToInt32(name);
                            EffectManager.Instance.DestroyEffect(id);
                        }
                    }
                }

                //创建吸附技能效果
                string       absortActPath     = "effect/soul_act/" + skillManagerConfig.absorbRes;
                NormalEffect absortSkillEffect = EffectManager.Instance.CreateNormalEffect(absortActPath, RealEntity.objAttackPoint.gameObject);

                if (absortSkillEffect != null)
                {
                    Quaternion rt = Quaternion.LookRotation(EntityFSMDirection);
                }
                objTransform.rotation = Quaternion.LookRotation(EntityFSMDirection);
            }
            else
            {
                if (skillManagerConfig.isNormalAttack == 1) //判断是否是普通攻击
                {
                    RealEntity.PlayeAttackAnimation();      //播放攻击动画
                }
                else//技能攻击
                {
                    RealEntity.PlayerAnimation(skillManagerConfig.rAnimation);//播放释放技能动画
                    //如果此动画不是循环模式
                    if (RealEntity.GetComponent <Animation>()[skillManagerConfig.rAnimation] != null && RealEntity.GetComponent <Animation>()[skillManagerConfig.rAnimation].wrapMode != WrapMode.Loop)
                    {
                        RealEntity.CrossFadeSqu("free");                                      //淡入free动画
                    }
                    HolyTech.Effect.EffectManager.playSkillReleaseSound(this, EntitySkillID); //播放技能释放的声音
                }

                float distance = GetDistanceToPos(EntityFSMPosition);//有什么用?
                if (entityType != EntityType.Building)
                {
                    objTransform.rotation = Quaternion.LookRotation(EntityFSMDirection);
                }
            }
        }
Пример #2
0
        public virtual void OnEntityReleaseSkill()
        {
            //////////////////////////////////////////////////////////////////////////////////////////
            //
            SkillManagerConfig skillManagerConfig = ConfigReader.GetSkillManagerCfg(EntitySkillID);

            if (skillManagerConfig == null)
            {
                return;
            }
            //吸附技能
            if (skillManagerConfig.isAbsorb == 1)
            {
                //删除已有的相同特效
                foreach (Transform child in RealEntity.objAttackPoint)
                {
                    if (child.name.Contains(skillManagerConfig.absorbRes))
                    {
                        int offset = child.name.IndexOf('_');
                        if (offset != 0)
                        {
                            string name = child.name.Substring(offset + 1);
                            int    id   = Convert.ToInt32(name);
                            EffectManager.Instance.DestroyEffect(id);
                        }
                    }
                }

                //创建吸附技能效果
                string       absortActPath     = "effect/soul_act/" + skillManagerConfig.absorbRes;
                NormalEffect absortSkillEffect = EffectManager.Instance.CreateNormalEffect(absortActPath, RealEntity.objAttackPoint.gameObject);
                if (absortSkillEffect != null)
                {
                    Quaternion rt = Quaternion.LookRotation(EntityFSMDirection);
                    //absortSkillEffect.obj.transform.rotation = rt;
                }
                objTransform.rotation = Quaternion.LookRotation(EntityFSMDirection);
            }
            else
            {
                if (skillManagerConfig.isNormalAttack == 1)
                {
                    RealEntity.PlayeAttackAnimation();
                }
                else
                {
                    {
                        RealEntity.PlayerAnimation(skillManagerConfig.rAnimation);
                        if (RealEntity.animation[skillManagerConfig.rAnimation] != null && RealEntity.animation[skillManagerConfig.rAnimation].wrapMode != WrapMode.Loop)
                        {
                            RealEntity.CrossFadeSqu("free");
                        }
                        BlGame.Effect.EffectManager.playSkillReleaseSound(this, EntitySkillID);
                    }
                }
                float distance = GetDistanceToPos(EntityFSMPosition);
                if (entityType != EntityType.Building)
                {
                    objTransform.rotation = Quaternion.LookRotation(EntityFSMDirection);
                }
            }
        }