private IEnumerable<SkillObj> GetTargets(SkillObj skillObj, double width, double height) { Vector3_Hzy tarVec; Vector3_Hzy srcVec = skillObj.GetPos(); var tList = skillObj.GetTarListnearby().Where(t => !t.IsDead()); List<SkillObj> tarList = new List<SkillObj>(); double srcDirRadian = skillObj.GetDirRadian(); foreach (var tar in tList) { tarVec = tar.GetPos(); if (BattleHelper.IsInRect_2D(srcVec, srcDirRadian, tarVec, width, height, skillObj)) { tarList.Add(tar); } } return tarList; }
private IEnumerable<SkillObj> GetTargets(SkillObj skillObj, double range) { Vector3_Hzy tarVec; Vector3_Hzy srcVec = skillObj.GetPos(); var tList = skillObj.GetTarListnearby().Where(t => !t.IsDead()); List<SkillObj> tarList = new List<SkillObj>(); double srcDirRadian = skillObj.GetDirRadian(); foreach (var tar in tList) { tarVec = tar.GetPos(); double distance = BattleHelper.Distance_2D(tarVec, srcVec); if(distance <= range) { tarList.Add(tar); } } return tarList; }