Skip to content

Commit

Permalink
Processing the animation data properties in the original order before…
Browse files Browse the repository at this point in the history
… PR #4174 (#4698)

Co-authored-by: Steven Yau <syau@snapchat.com>
  • Loading branch information
yaustar and steveny-sc authored Oct 6, 2022
1 parent 3fe1073 commit 27574e8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/framework/components/animation/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ class AnimationComponentSystem extends ComponentSystem {
* @ignore
*/
initializeComponentData(component, data, properties) {
for (const property in data) {
// properties need to be set in a specific order due to some setters in the component
// having extra logic. `assets` need to be last as it checks other properties
// to see if it should play the animation
properties = ['activate', 'enabled', 'loop', 'speed', 'assets'];
for (const property of properties) {
if (data.hasOwnProperty(property)) {
component[property] = data[property];
}
Expand Down

0 comments on commit 27574e8

Please sign in to comment.