-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Tween of the same type are always returning each their own unique IDs. #4
Comments
Tween IDs are the same if the following parameters are all the same. entity-tween/Runtime/Tweens/Components/TweenState.cs Lines 68 to 82 in e5ca94a
This way, if you create a tween with the same type in the same time, their IDs should be the same. However, by design, there can be only one tween of the same type on the same entity, and the new one should override the old one. It sounds like a bug if it doesn't work this way. Sorry for not having time to verify myself. |
I'm just wondering what part of the code disallow having two tweens of the same type other than:
Because that only add the target to the entity, but then after a new tween state is created and added to the buffer. That means that if you have two tweens of the same type, but started at different times, they'll appear twice in the buffer, right? At least that is what I see. There seem to be no system removing an active tween. Also, this part: Sorry for all the questions :) I should be able to do a merge request if I can find a way to fix the issue I have with multiple tweens of the same type not working as I expected. |
As far as I know, when you Therefore,
And I think you are right I missed the corresponding But how will it make sense to have 2 tweens altering the same property back and forth at the same time?
No worries! I'm happy to discuss with you if you find it interesting and you don't mind I might not respond immediately. To be honest, I kind of lost the passion for this project, since it feels like that Unity will abandon the whole idea of ECS/DOTS and this project will die eventually. So I spend my time on other things then. I once thought this project will be so helpful. |
I understand that! Just so you are aware, DOTS is not going to die. I am not quite sure what is going on, but many Unity developers are working on Hybrid renderer, DOTS Animation and so on. See this comment from Joachim. Anyway to me this is more for learning to handle ECS / data management efficiently more than anything at the moment. You are right that there can only be one component of the same type, but there can be more than one buffer. What that means is that when you add new states, the old ones persist and somehow are looping forever without being destroyed. I believe it is because the ID stored in the target no longer matches anything in the buffer. Anyway, I'm on something else now but if I ever return to fix it I'll be sure to share the code just in case you're curious :) |
Oh so it seems they are just busy doing something else.
I agree. Part of the reason why I made this project is for learning, and I did learn a lot about this new paradigm.
Yes I think the old one should be removed once the new one comes in.
It will be a great contribution to this project, along with the new extensible design. |
I just found that each time a new TweenState is created, it generates a unique ID. Is that by design? What if I want the current tween to go away when adding a new one?
For instance, if I start an alpha tween on some Ui but there is already one acting on it, I'd like the new one to override the old.
The text was updated successfully, but these errors were encountered: