コード例 #1
0
    public override void Execute(Steerable steerable)
    {
        // Override the steerable's min/max speed
        if (overrideSteerableSpeed)
        {
            steerable.MinSpeed = minSpeed;
            steerable.MaxSpeed = maxSpeed;
        }
        // Override the steerable's max force
        if (overrideMaxForce)
        {
            steerable.MaxForce = maxForce;
        }

        cohesion.Execute(steerable);
        alignment.Execute(steerable);
        separation.Execute(steerable);
        wallAvoidance.Execute(steerable);
        wander.Execute(steerable);
    }