Unity 油门控制器.docxVIP

  • 11
  • 0
  • 约2.41千字
  • 约 4页
  • 2017-12-14 发布于河南
  • 举报
Unity 油门控制器

还是一篇41post的翻译,对于老鸟们可能就没用了,这个脚本太简单了,但是小小鸟们可以看看,或许有点用能,希望大家喜欢!!!????下面正文:????这个Unity编程教程将展示如何创建一个让GameObject保持预订速率向前移动的脚本。这个油门速率控制器可以应用在像船,飞机,火车上。照例,Unity工程文件会在文章的结尾提供下载。????本教程的灵感来自于半条命,有一辆玩家可以驾驶的列车,你们可能已经不怎么记得了,来看看这张截图:下面这段代码也可以做到如此。来看看代码:usingUnityEngine;??usingSystem.Collections;??publicclassThrottleController : MonoBehaviour??{?????? //The game objects Transform????privateTransform goTransform;??????//the throttle increment to the current velocity????privatefloatincrement=0.0f;??????//this variable stores the vertical axis values????privatefloatvertAxis=0.0f;??????//the throttle????privatef

文档评论(0)

1亿VIP精品文档

相关文档