Allow Use And Registration of Generic Time Contexts#78
Open
Allow Use And Registration of Generic Time Contexts#78
Conversation
now tweens can be registered to fire on specific schedules per time context (common use: only fire fixed-ticked tweens on fixed update)
so that curves would only be sampled when relevant, and always sampled when relevant
so that, for example, fixed-time animations would only interpolate their tween values on fixed updates. This is crucial for them to work properly (for example, fixed translation tweens should only move their entities on fixed updates)
by adding a generic constructor and having the previous constructor call it defaultly
* separate plugins that should be registered ones, ones that should be registered per schedule and ones that should be registered per schedule and time context. * allow registering system sets per schedule (necessary for them to take effect) * allow adding tween systems to a specific schedule (necessary for the rest to work)
This prevents unnecessary breaking changes.
(Breaking) Add `schedule` field to `EaseKindPlugin`. Add `TimeCtx` generic to `EaseKindPlugin` with default to () Add `in_schedule` method to `EaseKindPlugin`. implement `Default` for `EaseClosurePlugin<()>` Update plugin to follow `TweenAppResource` deprecation while remaining backward-compatible. `EaseKindTypeRegistrationPlugin` and `EaseKindSystemRegistrationPlugin` is removed.
Add `TimeCtx` generic with default to `()` (Breaking) Add public `schedule` field. Add `in_schedule` method Rename `time_context_marker` to `marker` implement `Default` for `EaseClosurePlugin<()>` where schedule is `PostUpdate` Update plugin to follow `TweenAppResource` deprecation while remaining backward-compatible.
Add `TimeCtx` generic to `apply_asset_tween_system` Update `apply_asset_tween_system`'s query to filter for only tween with `TimeContext` Add `TimeCtx` generic to `asset_dyn_tween_system` Add `TimeCtx` generic to `asset_tween_system`
Add `TimeCtx` generic to `apply_component_tween_system` Update `apply_component_tween_system`'s query to filter for only tween with `TimeContext` Add `TimeCtx` generic to `component_dyn_tween_system` Add `TimeCtx` generic to `component_tween_system`
Add `TimeCtx` generic to `apply_resource_tween_system` Update `apply_resource_tween_system`'s query to filter for only tween with `TimeContext` Add `TimeCtx` generic to `resource_dyn_tween_system` Add `TimeCtx` generic to `resource_tween_system`
Add `TimeCtx` generic with default to `()` (Breaking) Add public `schedule` field and private `marker` field. Add `in_schedule` method implement `Default` for `DefaultInterpolatorsPlugin<()>` where schedule is `PostUpdate` Update plugin to follow TweenAppResource deprecation while remaining backward-compatible. Update systems to use `TimeCtx` Remove `DefaultInterpolatorsSystemRegistrationPlugin` Remove `DefaultInterpolatorsTypeRegistrationPlugin`
Add `TimeCtx` generic with default to `()` (Breaking) Add public `schedule` field and private `marker` field. Add `in_schedule` method implement `Default` for `DefaultDynInterpolatorsPlugin<()>` where schedule is `PostUpdate` Update plugin to follow TweenAppResource deprecation while remaining backward-compatible. Update systems to use `TimeCtx` Remove `DefaultDynInterpolatorsSystemRegistrationPlugin`
* it now takes TimeCtx generic with default of () * for_schedule constructor has been renamed to in_schedule * DefaultTweenEventPlugins now takes schedule as well, to register the default tween event plugins
* it now takes TimeCtx generic with default of () * on_schedule constructor has been renamed to in_schedule
* add default schedule and enable_debugging to DefaultTweenPlugins * remove TweenSchedulesDependentPlugins , system sets will now be registered in TweenScheduleAndStepDependentPlugins * register default tween event plugin on default schedule
since the app resource is now deprecated
* now there's only one main plugin * rename TweenScheduleAndStepDependentPlugins and make it private as there's now no need to register it from outside
* Rename all phantom data fields to `marker` * Update bevy_time_runner plugins to one * Make TweenCorePlugin take TimeCtx generic as well * Merge TweenSystemsPlugins into DefaultTweenPlugins
* add DefaultTweenPluginsOnDefaultTime for ease of use * update examples to use it * update changelog
* the previous component_tween_system retains api, the new fn allow for registration per TimeCtx * update changelog
see two previous commits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable use and registration of specific time contexts and schedules. Such as animations that only run on FixedUpdate on Fixed time context.