Exemple #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);
                }
            }
        }
Exemple #2
0
        public virtual void OnEnterSing()
        {
            SkillManagerConfig skillconfig = ConfigReader.GetSkillManagerCfg(EntitySkillID); //进那个配置文件

            RealEntity.PlayerAnimation(skillconfig.yAnimation);                              //播放回城动画

            //删除已有特效,如果没有,则跳过
            if (singEffect != null)
            {
                singEffect.transform.parent = null;
                GameObject.DestroyImmediate(singEffect);
            }
            //获取回城特效路径
            string path = GameConstDefine.LoadGameSkillEffectPath + "release/" + skillconfig.yEffect;
            //加载 backtocity 特效
            ResourceItem objUnit = ResourcesManager.Instance.loadImmediate(path, ResourceType.PREFAB);
            GameObject   obj     = objUnit.Asset as GameObject;

            if (obj == null)
            {
                return;
            }
            //创建特效
            singEffect = GameObject.Instantiate(obj) as GameObject;
            if (singEffect == null)
            {
                return;
            }

            //特效初始化
            singEffect.transform.parent        = RealEntity.objAttackPoint;
            singEffect.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f);
            string soundPath = GameConstDefine.LoadGameSoundPath + skillconfig.ySound;

            //音频设置
            ResourceItem soundObjUnit = ResourcesManager.Instance.loadImmediate(soundPath, ResourceType.ASSET);

            if (soundObjUnit.Asset != null)
            {
                AudioClip clip = soundObjUnit.Asset as AudioClip;
                if (clip != null)
                {
                    AudioSource Audio = AudioManager.Instance.PlayLongVoiceAudio(clip);
                    SceneSoundManager.Instance.addSound(Audio, RealEntity.gameObject);
                    singSound = Audio;
                    AudioManager.Instance.ChangeAudioVolume(Audio, 1.0f);
                }
            }
        }
Exemple #3
0
        //离开技能
        public virtual void OnEntityLeadingSkill()
        {
            SkillManagerConfig skillManagerConfig = ConfigReader.GetSkillManagerCfg(EntitySkillID);

            if (skillManagerConfig == null)
            {
                return;
            }

            RealEntity.PlayerAnimation(skillManagerConfig.rAnimation);

            float distance = GetDistanceToPos(EntityFSMPosition);//有什么用?

            if (entityType != EntityType.Building)
            {
                objTransform.rotation = Quaternion.LookRotation(EntityFSMDirection);
            }
        }
Exemple #4
0
        //完成技能后 LastingSkill
        public virtual void OnEntityLastingSkill()
        {
            SkillManagerConfig skillManagerConfig = ConfigReader.GetSkillManagerCfg(EntitySkillID);

            if (skillManagerConfig == null)
            {
                return;
            }

            RealEntity.PlayerAnimation(skillManagerConfig.rAnimation);//播放攻击动画

            ////如果此动画不是循环模式
            if (RealEntity.GetComponent <Animation>()[skillManagerConfig.rAnimation] != null && RealEntity.GetComponent <Animation>()[skillManagerConfig.rAnimation].wrapMode != WrapMode.Loop)
            {
                RealEntity.CrossFadeSqu("free");//淡入free动画
            }

            float distance = GetDistanceToPos(EntityFSMPosition);//有什么用?

            if (entityType != EntityType.Building)
            {
                objTransform.rotation = Quaternion.LookRotation(EntityFSMDirection);
            }
        }
Exemple #5
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);
                }
            }
        }