Conversation
… animation timeScaling to it.
…heir functionality. Event passes the float time scale value.
|
Notably, getTimeScale() had the code updating timescale code refactored into updateTimeScale(). During this change, instead of using unity deltaTime (which I wrongly used initially to represent time since last time timescale was updated), I correctly calculated the time elapsed since last update. The timeAcceleration value has been changed to roughly match the feel of this, and timeAcceleration now has a more intuitive representation - timeAcceleration of 4 means changing timescale by a factor of 4 takes essentially 1 second (not exactly because of the calculation occurs). This still has an issue of repeated multiplication at different rates being a slightly different curve to exponentiation. A better approach would be to simply use an exponential curve with timeAcceleration representing the maximum change in timeScale factor in 1second. |
…e factor at which time can change in 1 second.
|
TimeAcceleration now follows an exponential curve instead of mimicking it with repeated multiplication, so it no longer has any issues with updating on a potentially non-constant time |
… the animator for the component and subscribes to a WorkingTimeManager event which modifies the animation speed every time the TimeScale changes.
Adds event. Components with an animator can subscribe to this event and update the animator.speed value to have animations play at the correct timescale.