zoukankan      html  css  js  c++  java
  • Time.timeScale 时间缩放

    static var timeScale : float

    Description描述

    The scale at which the time is passing. This can be used for slow motion effects.

    传递时间的缩放。这可以用于减慢运动效果。

    When timeScale is 1.0 the time is passing as fast as realtime. When timeScale is 0.5 the time is passing 2x slower than realtime.

    当timeScale传递时间1.0时和实时时间一样快。当timeScale传递时间0.5时比实时时间慢一半。

    When timeScale is set to zero the game is basically paused if all your functions are frame rate independent.

    当timeScale传递时间为0时游戏基本上暂停了,如果你的所有函数是和帧速率无关的。

    Except for realtimeSinceStartup, timeScale affects all the time and delta time measuring variables of the Time class.

    除了realtimeSinceStartup,timeScale影响所有时间和增量时间基于Time类的变量。

    If you lower timeScale it is recommended to also lower Time.fixedDeltaTime by the same amount.

    如果降低timeScale,建议也降低Time.fixedDeltaTime同样的数值。

    FixedUpdate functions will not be called when timeScale is set to zero.

    当timescale设置为0时,FixedUpdate函数将不会被调用。

    // Toggles the time scale between 1 and 0.7
    // whenever the user hits the Fire1 button.
    //切换时间缩放在1-0.7之间,每当用户点击Fire1按钮。
    function Update () {
    if (Input.GetButtonDown ("Fire1")) {
        if (Time.timeScale == 1.0)
            Time.timeScale = 0.7;
        else
            Time.timeScale = 1.0;
        // Adjust fixed delta time according to timescale    
        // The fixed delta time will now be 0.02 frames per real-time second
        //根据timescale调整固定增量时间。
        Time.fixedDeltaTime = 0.02 * Time.timeScale;
        }
    }
  • 相关阅读:
    Docker 批量删除容器和镜像
    Matlab中xcorr命令解释
    关于递归总结
    关于STL的map的注意事项
    sublime text 3快捷键
    visual Assist常用快捷键
    学校到职场新人的总结
    Navicat for Mysql导入mysql数据库脚本文件
    欧美姓氏的来源
    linux tar.gz zip 解压缩 压缩命令
  • 原文地址:https://www.cnblogs.com/vincentDr/p/3681067.html
Copyright © 2011-2022 走看看