Type Method

behaviorWithGoals:

Creates a behavior with the specified goals.

Declaration

+ (instancetype)behaviorWithGoals:(NSArray<GKGoal *> *)goals;

Parameters

goals

An array of goal objects.

Return Value

A new behavior object. To assign a set of goals to an agent, use its behavior property.

Discussion

The new behavior contains the specified goals, each with a weight of 1.0. To change a goal’s weight after creating the behavior, keep a reference to that goal and use the setWeight:forGoal: method.

See Also

Creating a Behavior

+ behaviorWithGoal:weight:

Creates a behavior with a single goal.

+ behaviorWithGoals:andWeights:

Creates a behavior with the specified goals and weights.

+ behaviorWithWeightedGoals:

Creates a behavior with the specified mapping of goals to their weights.