override public void UpdateAgent(FlockAgent agent) { List <Transform> context = agent.GetNearbyObstacles(); Vector3 move = behavior.CalculateMove(agent, context); agent.Move(move); }
override public void UpdateAgent(FlockAgent agent) { List <Transform> context = agent.GetNearbyObstacles(); Vector3 move = behavior.CalculateMove(agent, context); move *= agent.DriveFactor; if (move.sqrMagnitude > agent.SquareMaxSpeed) { move = move.normalized * agent.MaxSpeed; } agent.Move(move); }