mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-04 04:47:13 +08:00
Let the user choose if the sequence should get stuck
This commit is contained in:
@ -72,7 +72,7 @@ This effect is a combination of other effects. You provide it with a list of you
|
|||||||
|
|
||||||
The effects in the list should only be passed to the SequenceEffect, never added to a PositionComponent with `addEffect`.
|
The effects in the list should only be passed to the SequenceEffect, never added to a PositionComponent with `addEffect`.
|
||||||
|
|
||||||
Note that no effects added to the sequence can have their `isInfinite` property set to `true`, because then naturally the sequence will get stuck once it gets to that effect.
|
Note that no effect (except the last) added to the sequence should have their `isInfinite` property set to `true`, because then naturally the sequence will get stuck once it gets to that effect.
|
||||||
|
|
||||||
You can make the sequence go in a loop by setting both `isInfinite: true` and `isAlternating: true`.
|
You can make the sequence go in a loop by setting both `isInfinite: true` and `isAlternating: true`.
|
||||||
|
|
||||||
|
|||||||
@ -15,9 +15,6 @@ class SequenceEffect extends PositionComponentEffect {
|
|||||||
isInfinite = false,
|
isInfinite = false,
|
||||||
isAlternating = false,
|
isAlternating = false,
|
||||||
}) : super(isInfinite, isAlternating) {
|
}) : super(isInfinite, isAlternating) {
|
||||||
/// All effects need to be finite, otherwise the sequence will get stuck
|
|
||||||
assert(effects.every((effect) => !effect.isInfinite));
|
|
||||||
|
|
||||||
/// No effects can be added to components from the start
|
/// No effects can be added to components from the start
|
||||||
assert(effects.every((effect) => effect.component == null));
|
assert(effects.every((effect) => effect.component == null));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user