Skip to content

Add AutoPlayMode enum to enhance animation playback control - #241

Merged
nuskey8 merged 1 commit into
annulusgames:mainfrom
yy4040:feature/playmode
Dec 20, 2025
Merged

Add AutoPlayMode enum to enhance animation playback control#241
nuskey8 merged 1 commit into
annulusgames:mainfrom
yy4040:feature/playmode

Conversation

@yy4040

@yy4040 yy4040 commented Aug 1, 2025

Copy link
Copy Markdown

This PR introduces a new AutoPlayMode enum to provide more flexible control over automatic animation playback in LitMotionAnimation.

The existing bool playOnAwake field has been replaced with AutoPlayMode autoPlayMode, allowing the animation to play either once on the first activation or every time the object is enabled.

✨ Key Changes

  • Added AutoPlayMode enum (OnceOnEnable, EveryEnable)
  • Replaced playOnAwake with autoPlayMode in LitMotionAnimation
  • Implemented ISerializationCallbackReceiver to migrate existing serialized playOnAwake data to the new autoPlayMode field
  • Updated corresponding editor script LitMotionAnimationEditor.cs to reflect new enum in the inspector

🎯 Purpose

Previously, the animation played only once when the object was first enabled. With this update, developers can choose to replay the animation every time the object becomes active, enhancing flexibility for dynamic UI or object behaviors.

vietdungdev pushed a commit to vietdungdev/LitMotion that referenced this pull request Dec 13, 2025
Add AutoPlayMode enum to enhance animation playback control annulusgames#241
vietdungdev added a commit to vietdungdev/LitMotion that referenced this pull request Dec 13, 2025
Add AutoPlayMode enum to enhance animation playback control annulusgames#241
@nuskey8
nuskey8 merged commit 19502df into annulusgames:main Dec 20, 2025
@nuskey8

nuskey8 commented Dec 20, 2025

Copy link
Copy Markdown
Member

Merged the PR. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants