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;
}
}
Time.timeScale 时间缩放的更多相关文章
- Unity 时间缩放状态下的特效播放
时间缩放状态下,比如 Time.timeScale 缩小为 0 或者 0.000001 等极小值时,若想将特效的播放速度放大相同的倍数,即修改 ParticleSystem.playbackSpeed ...
- Unity基础知识学习笔记二
1,object Instantiate(object original,Vector3 position,Quaternion rotation) 克隆原始物体,并返回克隆物体. ...
- Unity3D 之暂停和继续的实现
Time.timeScale 时间缩放 当timeScale传递时间1.0时和实时时间一样快.当timeScale传递时间0.5时比实时时间慢一半. 当timeScale传递时间为0时游戏基本上暂停了 ...
- 3GP文件格式研究
需要看的文档 http://www.3gpp.org/ftp/Specs/archive/26_series/ 3GPP TS 26.233 3GPP TS 26.243 3GPP TS 26.244 ...
- Unity的常用API
1.Event Function:事件函数 Reset() :被附加脚本时.在游戏物体的组件上按Reset时会触发该事件函数 Start() :在游戏初始化时会执行一次 Update() :每一帧 ...
- U3D Time类
Time.time 表示从游戏开发到现在的时间,会随着游戏的暂停而停止计算. Time.timeSinceLevelLoad 表示从当前Scene开始到目前为止的时间,也会随着暂停操作而停止. Tim ...
- Unity&C# Time时间相关
1.Unity Time类 1/ Time.time 表示从游戏开发到现在的时间,会随着游戏的暂停而停止计算. 2/ Time.timeSinceLevelLoad 表示从当前Scene开始到目前为止 ...
- Unity3D笔记 英保通二
一.访问另一个物体 1.代码中定义一个public的物体 例如:var target:Transform; 在面板上直接拖拽一个物体赋值给target 2.通过GameObject.Find(&quo ...
- (转)Unity3D - 动作动画忽略timeScale
转自:http://blog.csdn.net/ynnmnm/article/details/46866347 最近在调战斗时的动画与特效,Unity3D对加/减速提供了Time.timeScale支 ...
随机推荐
- WCF回调操作
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.s ...
- shell 将字符串分割成数组
代码:test.sh #!/bin/bash a="one,two,three,four" #要将$a分割开,可以这样: OLD_IFS="$IFS" IFS= ...
- vboxmanage查询正在运行的vbox虚拟机
系统:linux通用,virtualbox5.0 每次用下面命令启动vm虚拟机时,发现没办法知道它的IP. $ vboxmanage startvm <vmname> --type hea ...
- django的url匹配流程
URL匹配流程(路由解析顺序): URL匹配流程说明 域名.端口.端口后的 /,以及查询字符串(问号后面的键值参数)不参与匹配 先到项目下的 urls.py 进行匹配,再到应用的 urls.py 匹配 ...
- 本地yum仓库的搭建
. 1.直接断开网络,模拟生产内网环境 2.将原先的网络yum仓库全部移动到 backup目录下 3.创建本地yum仓库 local_yum.repo vi /etc/yum.repos.d/loc ...
- pycharm配置pep8
可以使用外部工具,来检查代码是否符合pep8的风格: 1)下载 autopep8,这个简单,pip3 install pep8 2)在pychamr中配置: A)file-setting..-tool ...
- (4)C#变量,常量,数据类型,转义字符,数据类型转换
一.变量 程序运行期间能够被改变的量称为变量. 变量名称要用小写字母开头,避免用下划线开头. 如果包含多个单词,从第二个单词开始首字母都要大写. 定义并初始化 double pi = 3.14 二.常 ...
- PL/SQL&存储过程||存储函数&触发器
plsql 有点:交互式 非过程化 数据操纵能力强 自动导航语句简单 调试简单 想率高 声明类型的方式 1.基本类型 2.引用变量 3.记录型变量 基本格式 declare 声明 b ...
- 01Trie树【p2420】 让我们异或吧
Description 异或是一种神奇的运算,大部分人把它总结成不进位加法. 在生活中-xor运算也很常见.比如,对于一个问题的回答,是为1,否为0.那么: (A是否是男生 )xor( B是否是男生) ...
- 【 模_板 】 for NOIP 2017
高精度 #include <cstring> #include <cstdio> #define max(a,b) (a>b?a:b) inline void read( ...