Closed crekri closed 1 year ago
Just noticed that the current architecture doesn't allow having two or more animation sequencers on the same game object, and if we try to create two different animation sequencer that controls the same game object and have it run more than once (e.g. button animate in > animate out > animate in), it will only work for the first time but not the second time. Seems like what I suggested would be completely breaking, so maybe I should work on my own fork instead.
Is what I am suggested impossible or is it just that I am using the system incorrectly?
Hey @degchris!
Yeah, I do think allowing more than one AnimationController per GameObject right now would cause a number of issues, it might be doable but would require some more in-depth refactoring.
I feel that having a dynamic step like this could cause multiple other issues that would have to be taken care of to properly support this.
I also think this might fall outside of the AnimationSequencer responsibility scope when dealing with a situation like this, this is how would setup:
My Button Prefab would have the following:
- Root Game Object
-- Button Content
-- Animations
--- Animation In (Sequencer Controller)
--- Animation Ou (Sequencer Controller)
So in this way, I have full control of what should be enabled/disabled per prefab. And when spawning multiple copies of the same instance, I normally have a list of spawned objects, it's easy to play all as I need.
Does that make sense to you? But yeah, feel free to create your own fork and change what you see fit!
Thanks for the suggestions!
I think this structure solves my problems, and I could still have a dynamic step through the use of additional tag scripts for labeling the animation. Again, thanks for the amazing work!
I want to propose adding a step for automatically getting all nested sequencers from the parent animation controller, and then playing all those nested sequencers automatically. This way, it would make animating dynamic contents (e.g. unknown amount of buttons and text from a popup) very easy. From my knowledge, no such step currently exists.
I originally want to implement it myself and then submit a pull request, but I am having trouble getting the step working for more than 2 layers of nested animation sequencers. Below is the script for reference:
To make this system even more useful, I also propose the changes below
If you think this feature is useful, I could write the code and submit a pull request. (Though I would need some help on solving the above issues)
*PS this asset is amazing, thanks for making it!