Ejemplo n.º 1
0
        public AreaEffect CreateAreaEffect(UInt64 owner, uint skillId, UInt32 id, Vector3 skillDir, Vector3 skillPos)
        {
            SkillAreaConfig skillConfig = ConfigReader.GetSkillAreaConfigInfo(skillId);

            if (skillConfig == null || skillConfig.effect == "0")
            {
                return(null);
            }
            string     resourcePath = GameConfig.SkillEffectPath + skillConfig.effect;
            AreaEffect effect       = new AreaEffect();

            effect.skillId     = skillId;
            effect.dir         = skillDir;
            effect.fixPosition = skillPos;
            effect.ID          = id;
            effect.resPath     = resourcePath;
            effect.Create();
            // 播放声音
            string soundPath = GameConfig.SoundPath + skillConfig.sound;

            effect.mAudioSource = AudioUtil.PlaySound(soundPath);
            AddEffect(effect.ID, effect);
            return(effect);
        }