Пример #1
0
 public override LinkedList <MYXZEntity> Pick(Transform player, IEnumerable <MYXZEntity> targets)
 {
     if (targets == null)
     {
         return(null);
     }
     this.Targets.Clear();
     foreach (MYXZEntity entity in targets)
     {
         if (MYXZMath.IsInPointArea(player.position, player.forward, entity.Transform.position, mMinDistance, mMaxDistance,
                                    mViewAngle))
         {
             this.Targets.AddFirst(entity);
         }
     }
     return(this.Targets);
 }
        public override List <Transform> Pick(Transform player, List <Transform> targets)
        {
            if (targets == null)
            {
                return(null);
            }
            List <Transform> results = new List <Transform>();

            foreach (Transform target in targets)
            {
                if (MYXZMath.IsInPointArea(player.position, player.forward, target.position, mMinDistance, mMaxDistance,
                                           mViewAngle))
                {
                    results.Add(target);
                }
            }
            return(results);
        }