Contents

subscript(_:)

Returns the weight associated with the goal specified by subscript syntax.

Declaration

subscript(goal: GKGoal) -> NSNumber! { get set }

Parameters

  • goal:

    A goal already included in the behavior’s set of goals.

Return Value

The weight to be applied to the goal’s influence on an agent’s speed and direction, or 0.0 if the goal is not in the behavior.

Discussion

This method is equivalent to the weight(for:) method, but allows access using subscript syntax.

See Also

Working with Goals Using Subscript Syntax