Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can LitMotionAnimation provide more APIs? #190

Open
eefan000 opened this issue Jan 3, 2025 · 8 comments
Open

Can LitMotionAnimation provide more APIs? #190

eefan000 opened this issue Jan 3, 2025 · 8 comments

Comments

@eefan000
Copy link

eefan000 commented Jan 3, 2025

More events:

  • Completed
  • Canceled
  • Completed or Canceled (Sometimes it is necessary to handle certain things after the animation is completed or canceled)

More Function:

  • Sample one frame based on incoming progress or time(Mainly used for state restoration or skipping animations)
@eefan000 eefan000 changed the title Can LitMotionAnimation provide more callback events? Can LitMotionAnimation provide more APIs? Jan 3, 2025
@Akeit0
Copy link
Contributor

Akeit0 commented Jan 11, 2025

@eefan000
Copy link
Author

eefan000 commented Jan 11, 2025

https://github.com/AnnulusGames/LitMotion/blob/main/src/LitMotion/Assets/LitMotion.Animation/Runtime/LitMotionAnimation.cs
This component requires more callback events

For example, some operations need to be performed after the animation has finished playing

@eefan000
Copy link
Author

Doesn't it look suitable for use in C # code?

@eefan000
Copy link
Author

I will use this component in the code, so I need to register the relevant callbacks in the code

@Akeit0
Copy link
Contributor

Akeit0 commented Jan 11, 2025

LitMotionAnimation is not intended to be modified from the user's C#code.
Programmer is supposed to use LSequence, but it might be a good idea to enhance LitMotionAnimation with features for Programmer as well. (It's not up to me, though.)

@eefan000
Copy link
Author

Use this component in the editor to quickly edit and preview animations
Then use animations in the code, and subsequent modifications do not require adjusting the code

@valorware
Copy link

valorware commented Jan 31, 2025

I really would like the ability for LitMotionAnimation to be able to Play in reverse, and force stop at END of animation.

Use case reverse: think of a door opening animation. Door will stay open for an undetermined amount of time, and then when no player is near, i can LitMotionAnimation.Play(-1) for example, to play it in reverse.

Use case force stop at END: imagine that same door, but its an important door/gate. Player opens it 1 time and animation plays. when they leave scene and load again, I can set the gate to be paused/stopped at the end of its animation, or play really fast or something, e.g. LitMotionAnimation.Play(10000); // play at fast speed

I know the lib isn't designed for complex animations, but i feel like these ae very simple requests -and I genuinely think these are really common and useful things to have exposed to us to make the library a lot more useful. I really like the LitMotionAnimation inspector window, but I think the Play/Pause/Stop/Restart functionality is a bit too limited unfortunately. Being able to pass speed into Play would go a long way I think!

I would like my designer to use the LitMotionAnimation inspector, which is why I want to avoid copying the animations to LSequence/code stuff

Many apologies if you CAN do the above currently somehow, but I found no way to?

Thank you

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

No branches or pull requests

3 participants