Esempio n. 1
0
        public static float MaxDistance(this IEnumerable<GameObject> entitys, Vector3 basePos, out GameObject furthestEntity)
        {
            var list = entitys.ToList();
            var maxDist = 0f;
            furthestEntity = null;
            foreach (var entity in list)
            {
                var dist = entity.GetPosistion().Distance(basePos);
                if(dist <= maxDist) continue;

                maxDist = dist;
                furthestEntity = entity;
            }
            return maxDist;
        }
Esempio n. 2
0
 public static Vector3 OffsetTowardHero(this Vector3 pos, GameObject gameObject, float distance = 10)
 {
     return pos.Extend(gameObject.GetPosistion(), distance).To3D((int)pos.Z);
 }