sequence(_:)
Creates an action that runs a collection of actions sequentially.
Declaration
class func sequence(_ actions: [SCNAction]) -> SCNActionParameters
- actions:
An array of Scnaction objects.
Return Value
A new sequence action object.
Discussion
When the action executes, the first action in the sequence starts and runs to completion. Subsequent actions in the sequence run in a similar fashion until all of the actions in the sequence have executed. The duration of the sequence action is the sum of the durations of the actions in the sequence.
This action is reversible; it creates a new sequence action that reverses the order of the actions. Each action in the reversed sequence is itself reversed. For example, the actions reverseSequence and sequenceReverse in the code example below are equivalent:
SCNAction *sequence = [SCNAction sequence:@[ actionA, actionB, actionC ]];
SCNAction *reverseSequence = [SCNAction sequence:@[ [actionC reversedAction],
[actionB reversedAction],
[actionA reversedAction] ]];
SCNAction *sequenceReverse = [sequence reversedAction];