コード例 #1
0
    override public void UpdateAgent(FlockAgent agent)
    {
        List <Transform> context = agent.GetNearbyObstacles();
        Vector3          move    = behavior.CalculateMove(agent, context);

        agent.Move(move);
    }
コード例 #2
0
    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);
    }