public static List <string> GetEffects(int heroId, bool isSkill) { List <string> result = new List <string>(); List <uint> effectIds = new List <uint>(); HeroData heroData = HeroData.GetHeroDataByID(heroId); if (heroData != null) { List <uint> skillIds = new List <uint>(); List <uint> mechanicsIds = new List <uint>(); if (!isSkill) { if (heroData.hitId > 0) { skillIds.Add(heroData.hitId); } if (heroData.passiveId1 > 0) { for (int i = 0; i < 5; i++)//预留5个被动效果 { int passiveMechanicsId = heroId * 100 + 55 + i; if (MechanicsData.ExistMechanicsId((uint)passiveMechanicsId)) { mechanicsIds.Add((uint)passiveMechanicsId); } } } } else { if (heroData.skillId1 > 0) { skillIds.Add(heroData.skillId1); } if (heroData.skillId2 > 0) { skillIds.Add(heroData.skillId2); } } for (int i = 0, count = skillIds.Count; i < count; i++) { SkillData skillData = SkillData.GetSkillDataById(skillIds[i]); if (skillData != null) { foreach (var kvp in skillData.timeline) { mechanicsIds.AddRange(kvp.Value); } if (skillData.effectIds.Length > 0) { effectIds.AddRange(skillData.effectIds, true); } if (skillData.aoeEffects.Length > 0) { effectIds.AddRange(skillData.aoeEffects, true); } if (skillData.aoeFlyEffects.Length > 0) { effectIds.AddRange(skillData.aoeFlyEffects, true); } if (skillData.flyEffectIds.Count > 0) { effectIds.AddRange(skillData.flyEffectIds, true); } } } for (int i = 0, count = mechanicsIds.Count; i < count; i++) { MechanicsData mechanicsData = MechanicsData.GetMechanicsDataById(mechanicsIds[i]); if (mechanicsData != null) { if (mechanicsData.effectIds.Length > 0) { effectIds.AddRange(mechanicsData.effectIds, true); } } } } //Debugger.Log("{0} effects count:{1}", heroId, effectIds.Count); for (int i = 0, count = effectIds.Count; i < count; i++) { //Debugger.Log("effect id:{0}", effectIds[i]); EffectData effectData = EffectData.GetEffectDataById(effectIds[i]); if (effectData != null) { switch (effectData.effectType) { case Logic.Enums.EffectType.Root: case Logic.Enums.EffectType.Trace: case Logic.Enums.EffectType.TargetArea: case Logic.Enums.EffectType.LockPart: case Logic.Enums.EffectType.LockTarget: case Logic.Enums.EffectType.CurveTrace: case Logic.Enums.EffectType.MoveTargetPos: case Logic.Enums.EffectType.FullScreen: string path = string.Format("effects/prefabs/{0}", effectData.effectName); if (!result.Contains(path)) { result.Add(path); } break; } } } return(result); }