init(behaviors:andWeights:)
Creates a behavior with the specified behaviors and weights.
Declaration
convenience init(behaviors: [GKBehavior], andWeights weights: [NSNumber])Parameters
- behaviors:
An array of behavior objects.
- weights:
An array of numbers, each of which is the weight to be applied to the behavior at the corresponding index in the
behaviorsarray.
Return Value
A new behavior object. To assign a behavior to an agent, use the agent’s behavior property.