Transferred from: http://blog.csdn.net/ynnmnm/article/details/46866347
Recent animations and effects during the battle, Unity3d provides time.timescale support for acceleration/deceleration. However, timescale provides a global time scale, and some of our actions or animations do not want to be slowed down by timescale. For example, when playing big strokes in the legend of the turret, all other actions/animations are paused except for the big trick effects.
Below are the Ignoretimescale methods for animation, animator, and particle effects respectively.
Animation
The Time.realtimesincestartup record is the real time that is unaffected by the timescale, and it is used to play animation at each frame of the sample. The code snippet is as follows:
// Current animation State // Current Real Time // The time interval between this frame and the previous frame // record This frame time, the next frame with // time the animation has played // animation normalization time [0-1] // samples the animation in its current state and uses it when you want to explicitly set the animation state and sample it
Animator
Animator _animator = ...; Public void Update () { // specifies that the animator update mode is not affected by scale}
Particle effects for Particleemitter
Particleemitter _emitter = ...; Public void Update () { _emitter. Simulate (time.unscaleddeltatime);}
For Particlesystem
Particlesystem _particlesystem = ...; Public void Update () { truefalse);
(GO) Unity3d-action animation ignores timescale