Example #1
0
        /*------------------------------------------------------------------*\
        |*							IEntity implementation
        \*------------------------------------------------------------------*/


        public void SetDestination(Vector3 position)
        {
            if (Selected.Count == 1)
            {
                Selected.First().SetDestination(position);
            }
            else
            {
                var offsets = Formations.Square(Selected.Count, position, Offset);
                Selected.Zip(offsets, Tuple.Create).ForEach(i => i.Item1.SetDestination(i.Item2));
            }

            if (Selected.Count > 3)
            {
                Selected.ForEach(e => e.Agent.stoppingDistance = 1f);
            }
        }