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支 ...
随机推荐
- artDialog组件与iframe
背景 组件官网. 未用过的朋友可以先了解下. 当Content参数传递html元素时,官方的解释是: 备注:1.元素不是复制而是完整移动到对话框中,所以原有的事件与属性都将会保留 2.如果隐藏元素被传 ...
- 27.Remove Element---两指针
题目链接:https://leetcode.com/problems/remove-element/description/ 题目大意:给出一个数组和一个值,从数组中删除与当前值相等的值,并将数组长度 ...
- 【linux高级程序设计】(第十二章)Linux多线程编程 3
条件变量通信机制 条件变量必须配合互斥锁一起实现对资源的互斥访问 使用方法: int pthread_cond_init (pthread_cond_t *__restrict __cond, __c ...
- AC日记——Little Elephant and Function codeforces 221a
A - Little Elephant and Function 思路: 水题: 代码: #include <cstdio> #include <iostream> using ...
- 同步mysql数据到ElasticSearch的最佳实践
Elasticsearch是一个实时的分布式搜索和分析引擎.它可以帮助你用前所未有的速度去处理大规模数据.ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全 ...
- React+dva.js+typescript实现百度贴吧移动web端
个人练习作品,有bug欢迎在github上提:) github地址:https://github.com/axel10/react-tieba 整个项目中实现起来最麻烦的应该算是滚动位置记忆和路由动画 ...
- csu1808
csu1808 题意 n 个点间有 m 条地铁,每条地铁可能属于不同的线路,每条地铁有权值即通过时花费的时间,如果乘坐第 i 条地铁来到地铁站 s,再乘坐第 j 条地铁离开,需要花费额外的时间 \(| ...
- spring线程并发处理(ThreadLocal)
我们知道Spring通过各种DAO模板类降低了开发者使用各种数据持久技术的难度.这些模板类都是线程安全的,也就是说,多个DAO可以复用同一个模板实例而不会发生冲突. 我们使用模板类访问底层数据,根据持 ...
- mysql----kill慢查询
每个与mysqld的连接都在一个独立的线程里运行,您可以使用SHOW PROCESSLIST语句查看哪些线程正在运行,并使用KILL thread_id语句终止一个线程. 如果您拥有SUPER权限,您 ...
- Tiny 6410的Linux学习总结!
1.Tiny6410的Linux系统修改IP地址: vi /etc/eth0-setting 2.Ubuntu14.04自动以root身份登录系统: /etc/lightdm/lig ...