Unity3d-action animation ignores timescale

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.