flame-engine / flame

A Flutter based game engine.
https://flame-engine.org
MIT License
9.19k stars 899 forks source link

fix: Invoke `setToStart` on child effect controller of wrapping effect controllers #3168

Closed ufrshubham closed 4 months ago

ufrshubham commented 4 months ago

Description

DelayedEffectController was not calling setToStart on its child, causing it to not behave as expected when used with InfiniteEffectController. This was reported by a discord member in this message.

This PR introduces a HasSingleChildEffectController mixin which can be added to any effect controller that wraps a single child effect controller. This mixin makes sure that the setToStart, setToEnd and onMount methods always get invoked on the child controllers.

Checklist

Breaking Change?

Related Issues

NA