void Start()
        {
            var spawnPositions = spawnFormation.GetPositions(Vector3.zero, count, 1);

            for (var i = 0; i < count; i++)
            {
                DoSpawn(spawnPositions[i]);
            }
        }
Beispiel #2
0
        void GiveOrder(Vector3 position)
        {
            var doubleRadius = controlledAgents[0].radius * 2;
            var positions    = formation.GetPositions(position, controlledAgents.Count, doubleRadius);

            for (var i = 0; i < controlledAgents.Count; i++)
            {
                controlledAgents[i].SetDestination(positions[i]);
            }
        }
        void Start()
        {
            ordering.Avoidance = avoidance;

            var spawnPositions = spawnFormation.GetPositions(Vector3.zero, count, 1);

            for (var i = 0; i < count; i++)
            {
                DoSpawn(spawnPositions[i]);
            }
        }
        void GiveOrder(Vector3 position)
        {
            if (controlledAgents.Count <= 0)
            {
                return;
            }

            var distance = controlledAgents[0].radius * 2;

            if (Avoidance)
            {
                distance *= Avoidance.Distance;
            }

            var positions = formation.GetPositions(position, controlledAgents.Count, distance);

            for (var i = 0; i < controlledAgents.Count; i++)
            {
                controlledAgents[i].SetDestination(positions[i]);
            }
        }