コード例 #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.IsInRectArea(player.position, player.forward, entity.Transform.position, this.m_width, this.m_length))
         {
             this.Targets.AddFirst(entity);
         }
     }
     return(this.Targets);
 }
コード例 #2
0
        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.IsInRectArea(player.position, player.forward, target.position, this.mWidth, this.mLength))
                {
                    results.Add(target);
                }
            }
            return(results);
        }