摘要: static vardeltaTime: floatDescription描述The time in seconds it took to complete the last frame (Read Only).以秒计算,完成最后一帧的时间(只读)。Use this function to make your game frame rate independent.使用这个函数使和你的游戏帧速率无关。放在Update()函数中的代码是以帧来执行的.如果我们需要物体的移动以秒来执行.我们需要将物体移动的值乘以Time.deltaTime。If you add or subtract to a v 阅读全文
posted @ 2013-07-19 11:26 马语者 阅读(1428) 评论(0) 推荐(0) 编辑
摘要: Unity中Update和Lateupdate的区别。Lateupdate和Update每一祯都被执行,但是执行顺序不一样,先执行Updatee然后执行lateUpdate。如果你有两个脚本JS1、JS2,两个脚本中都有Update()函数, 在JS1中有 lateUpdate ,JS2中没有。那么 lateUpdate 函数会等待JS1、JS2两个脚本的Update()函数 都执行完后才执行。也就是说, 如果现在有100个脚本,分别有100个 Update()函数,其中只有一个LateUpdate,那么在同一祯中,等待100个Update()执行完后,才执行这一个lateUpdate()。这 阅读全文
posted @ 2013-07-19 11:24 马语者 阅读(14468) 评论(2) 推荐(1) 编辑
摘要: I know how to make the raycast ignore a layer but I want it to ignore layers 9 and 10 but collide with the rest of the layers.I would do it the other way round: declare the variable private and use theSerializeFieldattribute. This way you can edit the variable in the inspector and keep it private so 阅读全文
posted @ 2013-07-19 10:48 马语者 阅读(887) 评论(0) 推荐(0) 编辑