init(behaviors:)
Creates a composite behavior from the specified individual behaviors.
Declaration
convenience init(behaviors: [GKBehavior])Parameters
- behaviors:
An array of behavior objects.
Return Value
A new behavior object. To assign a behavior to an agent, use the agent’s behavior property.
Discussion
The new behavior contains the specified behaviors, each with a weight of 1.0. To change an individual behavior’s weight after creating the composite behavior, keep a reference to that behavior and use the setWeight(_:for:) method.
For more information, see GameplayKit Programming Guide.