Closed musjj closed 2 months ago
It's currently private to minimize future breaking changes as I assume they won't be stable. I guess it would be fine for now with getter or setter functions. What field needed to be public and does it requires mutability? Could this also be solved by wrapping this struct to a new struct with new extension trait?
For the specific method I'm trying to implement, I'd need mutable access to EntityCommands
so that I can add additional components to the entity. The method would need to be able to add the SkipTweener
component, a custom component to store the previous tween entity and also call the set_paused
method.
I don't think a wrapper struct would let me access those fields though.
Oh you can access EntityCommands
before calling .animation
. .insert*
will also returns EntityCommands
. You can also use .paused
method on AnimationBuilder
. Would this work?
Yeah, but what I'm hoping is that I can do all that in a single method. Something like .animation().insert(/* ... */).after(/* entity */)
would be super clean.
Hmm, having .after
method after .insert
probably wouldn't work since .insert*
method will insert the TimeRunner automatically and TimeRunner won't be accessible after. I'm happy to allow access on EntityCommands
in any case, seems like a good thing to have.
Oh, yeah you're right, the .after
would have to be done before .insert
right?
Alright, I've pushed 63437d6. I've added getters to the inner TimeRunner and EntityCommands.
Oops wait I think the method should return &Option<TimeRunner>
not Option<&TimeRunner>
Edit: 2f334b4
Thank you! I'll experiment with it a bit before closing the issue.
Ok, I think it's working pretty well. Thanks again!
I'm trying to add my own helper method for
AnimationBuilder
to support this use case: https://github.com/Multirious/bevy_tween/issues/13But the problem is that all the struct fields are private:
https://github.com/Multirious/bevy_tween/blob/417c173df1a73f4d103665e90fcfd60b875f720d/src/combinator.rs#L259-L263
Would it be reasonable to make those fields public?