예제 #1
0
 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;
 }
예제 #2
0
파일: Range.cs 프로젝트: hzy125060691/apple
 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;
 }