unity开发赛车游戏中文教程之一

-
unity开发赛车游戏中文教程之一
The very basics. we will not go in depth with explaining the basic workflow and components in Unity. For that there are any other resources available at 非常基本的,我们不会深入解释ntg中基本的流程和组件,关于那些有许多其它有效的资 源 co/support/documentation/videol http://unity3d.cown/support/resources The User Manual and the Scripting Reference are valuable comp anions as you follow along this tutorial. We suggest that you visit these resources when ever you encounter a built in Component or function that you'd like to know ore about 用户手册和胸本参考是你在本教程的后续学习中很有用的伙伴。无论何吋,你在构建个组 件和函数时你都可以访问它们,如果你希望了解更多的东西得话。 The approach taken at first is that of code monkey see, code monkey do: You follow the instructions we give about putting a car together and changing it's variables. Hopefully you will be curious about how it works, learn something from seeing how everything is put together and do sowe investigation on your own Feel free to explore 开始的代码像是猴子编写的,包括你随后键入的这些由我们给出的和汽车放到一起的指令 并且可改变它变量值的代码,希望你会好奇它是如何工作,通过自凵做调查,如何把所有的 东西组装到一起来学习一些东西。使得探索变得自由一些。 In the last and longest section we dive more deeply into the actual code that akes the car drive 在最后和最长的部分,我们将更深入实际的代码,了解制造汽车的驱动器。 This is not a line-by-line walkthrough, but we will cover most of what is going onOne way to learn programming or improve ones skills is to look at a lot of code(supplemented by doing a lot of programming). we are certain that you will learn a lot from following this closely and getting an understanding of how the code works together 这不是一个线性的讲述,但我们尽量覆盖大多数内容,一种方法是通过看大量的代码学习和 提髙编程的技能(通过做很多编程练习),我们确信,你将接近)越来越理解一个代码是如 何·起⊥作的 包 Pro Standard assets sCenes Part 1: Assembling the Car E CompleteScene R TheTrack Download the zipped project folder from 回 scripts La Birds Behaviour 从下面的地址下载项目文档的压缩包 a Blohshadowcantroller http://unity3d.cown/support/resources/fi les/CarTutorialzip Start by opening the scene named CommpleteScene'. This scene has the car already setup, so you can try it out by pressing the Play button. This will show you the end result of what we are going to build 打开名称为“ Commpletescene”的场景,这个场景中已经放置了·辆汽车,所以你能试着 按下“Plag”按钮把汽车开出去,这就是我们最终将要构建的结果。 When you are done playing around, open the scene nanedTheTrack'. This scene contains what is needed to race, except the mnost immportant part -a car 当你玩完了,打开名为“ TheTrack”的场景,这个场景包含了我们需要的竞赛资源,除了 最重要的部分--一辆汽车。 Now drag the car model into the Scene. In the Project view you find it under Models,/car/ catamount№t 现在拖动一个汽车模型到场景中,你会在项目视窗中找到它,在 Models/Cav/ catamount. 目录下。 Depending on where you dragged the car, you probably want to change it's position to a more suitable one. I suggest that you change its position in the inspector to something like(860, 102.3, 878)and set it's y-rotation to 130 根据你拖动汽车的位置,你可能需要改变它 的位置到一个更适合的地方,我建议你在检 查视窗中改变它的位置到一些例如 (86O,102.5,878)这样的地方,并且设 置它绕Y轴的旋转角为13度。(注意不是与 Y轴的夹角) For the rest of the tutorial, this Gameobject will be referred to as ' Car' so you might as well rename it now 在剩余的教程中,这个游戏对象将被叫成“Ca”,所以你还不如现在就将它改名。 This is just the 3D model of the car. If you look in the Inspector, you will see that it contains a number of children such as the car's body, windows and wheels.It also contains two simple meshes that we will use for the car's colliders. Don't worry about them being visible for now, we will change that. Take soe time looking at how the car is arranged by different parts, and how they are related to each other in the hierarchy 这仅仅是一个汽车的三维模型。如果你查看检査视窗,你将看到一系列」对象,例如车身, 车窗和车轮,它也包含了两个简单的网格面,我们将用它做汽车的碰撞器。现在不要担心它 们会被看见,我们将改变它。花一些时间看看汽车的不同部分是如何放置的,以及他们如何 在彼此不同的层次上进行关联。 For various reasons, we want the car to be in it's own layer. With the Car Gameobject selected, go to the Inspector and select 'car' in the layers drop down menu. In the popup menu click ' Yes, change children to make the change apply to all Gameobjects in the car's hierarchy 由于种种原因,我们希望汽车将呆在它自己的层。选择汽车游戏对象,到检套视窗中并且在 下拉菜单中选择“car”这个层,在弹出菜单中点击“Yes, change children”,应用改变 汽车的所有子对象的继承 The Car GameObject has an Animation component attached by default. Since this is not something we are going to use, go ahead and do a little clean up by clicking the small wheel to the right of the Animation Component and selecting Remove component 缺省的汽车游戏对象有一个动画组件,由于在这里我们不用它做什么事,所以来吧,做一下 小清洁,点击小轮子动画组件的右侧,然后选择删除组件′。 Adding Collision增加碰撞 t区 Collide,_Bottom I ag Untagged Layer La Disco Select Reconnect Now we'l set up the collision A Trar storm conponents for the car to prevent it、下2 Position z 3 Ecale from falling through the ground when K d Y121 VE Collider Bottom IMesh Filter Mesh 围 Collide- botta m s Mesh Renderer running the scene. Instead of using+s Mesh Collider 回 Material complex mesh colliders based on the Smooth Sphere collisions Mesh 围 Collider botta m actual mesh of the car, we have setup Collider bottommat Shader Di fuse two meshes that are nuch simpler, Main Color FaSP(ETiR) (extI rPm Tiling offset that fit the top and bottom of the car seler For performance reasons, we are using these meshes as the collision model 现在我们将设置一个碰撞组件给汽车,以阳止它在场景中运动发生坠落时穿过地面,我们将 设置两个网格面米替代实际的复杂汽车网格面碰撞器,我们设置的两个网格面更简单一些, 它们将正好覆盖汽车的顶部和底部,出于性能的原因,我们使用它们作为汽车的碰撞模型。 Click on the Collider- Bottomm game object which is located as a child of the Car. 在汽车对象的」对象 Collider botton游戏对象上单击。 (先把这个对象下的组件都删掉,默认的都不是) Go to the Component/Physics Menu and click the Meshcollider to add one to the game object 到 Componεt/ Physics菜单上并且单击,给游戏对象增加一个网格面碰撞器 Meshcollider Click the Material dropdown-selector on the newly added Meshcollider conponent and select the Car physics mmaterial 在新埤加的网格面碰撞器上单击材料的下拉选择按钮并且选择Ca的这个物理材料。 Check the two boxes 'Smooth Sphere Collisions'and'Convex' 勾选两个检查盒“ Smooth Sphere collisions”(平滑球面碰撞)和“ Convex”(顶点) (网格面Mesh选择“ Collider botton”, Mesh renderer这个是给网格面加材质渲染, Mesh filte又是做什么的呢?) Since the colliders are going to be invisible, go ahead and remove the MeshRenderer and Mesh Filter Conponents from the Gameobject(Click the small cog wheel to the right of the Components and select Remove Component) 因为碰撞器将不可见,所以从游戏对象上删除 MeshRendereγ和 Mesh filte组件(单击组 件右边的小齿轮并且选择“删除组件”) Do the same as above for the collider- Top gamme object 参照上面对 Collider-Top游戏对象做相同的事情(网格面Mesh选择“ Collider-Top”) Shadow settings for the car oder汽车模型的阴影设置 We are going to change the shadow settings for the car model for two reasons First of all turning off shadow casting or receiving for objects that don't really need it is very good practice for performance reasons. Second of all we feel that it looks better to not have the car receive shadows. It might be more pleasing to the eye that shadows are not constantly appearing and disappearing on the car when it is traveling at high velocity under the level geometry. it's up to you what you prefer though. If you want more realistic shadow behavior, it is entirely possible. Just change the settings according to your liking 对于我们将要改变的汽车模型的阴影设置有两个理由,首先根据非常好的性能方面的实践, 关闭所有游戏对象阴影或接受阴影这个要求不是真的需要。其次,我们觉得车接收阴影并不 能使车看起来更好,它也许会悦目一些,从几何层次上看,阴影不断地在高速行驶下的汽车 上出现和消失,就看你喜欢什么了,如果你想实现更接近现实的影子的行为,这也是完全可 能的,根据自己的喜好仅仅改变设置就可以达到。 (阴影的设置是在 Mesh renderer中的参数上设置的,包括 Cast shadows投射阴影和 Receive shadows接收阴影) The settings we use for the various parts of the car are the following 我们使用的一部分汽车的设置如下: Body: Cast shadows enabled Receive Shadows disabled 车身: Cast Shadows投射能够,Receⅳ ve shadows接收不能够。 Body interior Cast Shadows enabled Receive shadows disabled 车内: Cast shadows投射能够, Receive shadows接收不能够。 Car Windows: Cast and Receive shadows disabled 车窗:Cast和Recε ive shadows投射和接收都不能够。 DiscBrakes: Cast and Receive Shadows disabled 盘式制动器:Cast和Receⅳ ve shadows投射和接收都不能够。(一殷外面也看不到) Wheels: Cast Shadows enabled Receive shadows disabled 车轮: Cast shadows投射能够,Rεcεⅳ ve shadows接收不能够。(车轮要在路面上投射阴 影,车轮一部分是橡胶制的,不反射,一部分是轮毂,佥金属制,但在高速旋转,接收也看不 到 Adding the Car's Components增加汽车的组件 Now let's start adding the components needed to make the car actually work onto the Car Gameobject 现在让我们开始给汽车游戏对象増加需要的组件,以使得汽车能按实际情况工作。 First of all, we need a way to control the car's position in the world by physical simulation, and the built-in rigidBody conponent is perfect for that. with the Car Game Object selected go to the Components menu and select Physics/ Rigid Body. Accept the message Unity gives you about losing prefab connection, and observe how the Gameobject now has a rigidbody attached as one of it's components 首先,我们需要一个方法来控制汽车在物理模拟世界中的位置,并且在其内部构建一个刚体 组什来完善它。选择汽车游戏对象,在 Components菜单下选择 Physics,/ Rigid Boa!y,接 受w比ty给出的失去预制物体连接的信息,并且观察游戏对象现在如何获得一个刚体组件。 The car obviously weighs more than just one kilo, so start by changing the Rigidbody 's ass to something A Rigi Mass 1500 More realistic like 1500 Drag 这款车显然不仅仅只有一公斤重,因此, Angular Drag 0 Use Gravity 廾始通过改变刚体的质量,使得它看起 Is Kinematic Interpolate None 来有500公斤。(Ma单位是K, Freeze rotation 坐标的单位是M) Next we have the drag and angularDrag properties, which are forces that slow down the rigidbody 's speed and rotation. we will control the drag of the car through scripting, so just set the drag and angularDrag properties to o 下一步我们设置rag摩擦力和 angularDrag角摩擦力属性,它们可以强迫刚体的速度 和旋转变慢,我们将通过脚木控制汽车的摩擦力,所以只把aag和 angularDrag属性值 设为O Locate the Car js script in the folder 'scripts/ JavaScripts'and drag it onto the Car Gameobject. This script is the Frun wheel Size 2 engine" of the car, and is the Element 0 A Disc BrakeFL Transform) 上 ement⊥ A DiscBrakeFR(Transtorm Rear wheels script we will focus on explaining Size 2 Element 0 DiscBrakeRL(Transform Element 1 A DiscBrakeRR (Transform 比 most at the end of I op speed tutorial. 在 scripts/ Javascripts’目录下查找 Car s脚本,并且拖动它到汽车游戏对象上,这个 木是汽车游戏对象的“引擎”,并且是脚本中,在这木教程中我们将着重解释比较底层中的 大多数。 The Car-script component has a lot of different variables that will be explained when we start tweaking the car, and even ore when we walk through the code For now we just want to setup what is needed to be able to take the car for a quick test run 当我们开始调整汽车吋,汽车脚本组件中有许多不同的变量将被解释,并且当我们编写代码 时解释的甚至更多,现在我们只想设置必须的,以使我们能够快速的测试运行汽车。 First of all, the car script needs to know about the wheels that the car hasIn the inspector you will see the Front wheels and the Rear Wheels, and notice that both of them can be expanded by clicking on the small arrow to the left of the names 首先,汽车脚本需要了解汽车的车轮。在检查视窗中你将看到 Front Whee/s前轮和Rea Wheels后轮,并且注意到,他们都可以通过名字左边的小箭头点击展开 Set the size of the front and Rear wheels to 2, waking room for two front wheels and two rear wheels 设置前轮和后轮的对象的数组维数为2,使得汽车有两个前轮和后轮。 Now expand the WheelFL, wheelFR, wheelrl and WheelRR in the inspector

-
2014-09-23
-
2014-06-08
-
2014-03-28
-
2013-07-02
232.58MB
Unity 3D 游戏开发经典教程-2
2018-07-26Unity 3D 游戏开发经典教程-1 Unity 3D 游戏开发经典教程-2 Unity 3D 游戏开发经典教程-3 Unity 3D 游戏开发经典教程-4 分4次上传 38集全。 本资源来源于网络
27.61MB
Unity3D游戏开发教程.pdf
2015-05-04《Unity 3D游戏开发》通过实例详细介绍了如何使用Unity进行游戏开发,书中先简要介绍了Unity环境搭建、编辑器和GUI游戏界面相关的知识,接着介绍了如何使用C#和JavaScript构建游戏
31B
Unity3D游戏开发标准教程-配套代码资源网盘地址
2017-03-11Unity3D游戏开发标准教程-配套代码资源的网盘地址,绝对正版。
27.57MB
Unity3D游戏开发标准教程-PPT课件上
2017-03-11Unity3D游戏开发标准教程-PPT课件,正版全面,制作精良。
70B
Unity2017 3D 游戏开发教程
2019-04-10包含C#基础以及unity基础和进阶。适合小白入门的教程!
8.71MB
unity3d官方赛车游戏教程中文版
2012-07-02unity3d官方赛车游戏教程中文版,某位达人自己翻译的,感恩!对应官方的素材,慢慢练习吧。
27.82MB
unity3d游戏开发实例教程 附带源码(工程文件)
2014-07-25unity3d游戏开发实例教程 附带源码(工程文件)
53B
大型unity教程RPG游戏制作教程
2017-12-18unity视频教程,已经整理链接分享。放心下载学习。祝你成功
28.7MB
Unity3D 游戏开发 PDF完整版
2013-05-24Unity3D书籍,现在Unity3D书籍很难找,对Unity3D感兴趣的可以下载看看
2.0MB
使用Unity3D 开发多人在线游戏
2018-04-25这是本讲述如何使用Unity3D 开发大型多人在线游戏的国外教程
108.54MB
Unity游戏开发实战.pdf
2013-12-30Unity游戏开发实战.pdf 比雨林木风那本更好的unity3d游戏开发书。 难得的中文好书
103.90MB
Unity 3.x游戏开发经典教程,完整扫描版
2014-10-09本书通过从零开始创建一个完整的Unity游戏项目,在对游戏进行一步步创建、完善的过程中向读者详细介绍了如何利用地形系统刷出简易的游戏环境、编写脚本控制对象的行为、利用图形用户界面(GUI)系统制作UI
12.3MB
Unity+游戏案例开发大全
2015-05-25Unity+游戏案例开发大全
203B
unity3d恐怖游戏开发模板
2018-09-30unity3d恐怖游戏开发模板unity3d恐怖游戏开发模板unity3d恐怖游戏开发模板unity3d恐怖游戏开发模板
208.7MB
Unity 3D 游戏开发经典教程-1
2018-07-26Unity 3D 游戏开发经典教程-1 Unity 3D 游戏开发经典教程-2 Unity 3D 游戏开发经典教程-3 Unity 3D 游戏开发经典教程-4 分4次上传 38集全。 本资源来源于网络
74.60MB
Unity游戏开发实战(原书第2版)2015.11 pdf 高清扫描
2017-06-13《Unity游戏开发实战(原书第2版)》结合Unity这种多平台的集成引擎和编辑器,介绍如何使用Unity创建游戏、添加交互性,以及修饰游戏并发布游戏的所有知识。本书分为五部分,每一章都介绍一个独立的
127B
Unity游戏开发实战
2019-07-23资源名称:Unity游戏开发实战内容简介:《Unity游戏开发实战》结合unity这种多平台的集成引擎和编辑器,介绍如何使用unity创建游戏、添加交互性,以及修饰游戏并发布游戏的所有知识。《Unit
87.54MB
Unity 5实战 使用C#和Unity开发多平台游戏
2018-04-01Unity 5实战 使用C#和Unity开发多平台游戏,Unity 5实战 使用C#和Unity开发多平台游戏,Unity 5实战 使用C#和Unity开发多平台游戏
61.34MB
基于Unity3D的简单FPS游戏教程
2018-07-11简单的FPS游戏教程,十分完整,适合初期接触Unity3D的同学学习,并且整理了FPS-Tutorial的素材包,使用更方便
8.46MB
Unity游戏开发入门教程
2015-08-21书内容很简单易懂,谁都可以跟着教程学习并操作。内容不多,但是可以帮助没用过u3d的人 熟悉界面操作等。作者幽默诙谐,书一点都不枯燥,易读易懂易上手~
12.62MB
Unity 2D游戏开发秘籍
2015-11-18由于Unity强大的功能、持续的改进和惊人的全球社区,Unity是现在世界排名第一的游戏引擎。使用Unity制作游戏,只需进行一次设计、编码,然后就可以将其部署到多个平台,传递给海量的玩家,从而获得最
2.1MB
Unity开发vr眼镜中文入门教程
2016-04-01Unity开发vr眼镜中文入门教程
39.18MB
unity 2d游戏开发实例教程
2017-08-1716年出版新书
43.46MB
Unity游戏开发入门经典附书资源17-21
2017-07-24Unity游戏开发入门经典附书资源17-21
743KB
Unity游戏人工智能(AI)开发
2014-02-23Unity游戏人工智能(AI)开发教程
49B
Udemy - 制作游戏代码教程 - 完整的Unity开发人员学习教程
2017-05-03Udemy - 制作游戏代码教程 - 完整的Unity开发人员学习教程
125B
编程开发之游戏蛮牛unity3d系列教程
2019-07-23资源名称:编程开发之游戏蛮牛unity3d系列教程 教程内容:第五季:unity核心编程系列 第六季:2D实战游戏实例 第七季:游戏蛮牛虚拟现实系列实例第八季: 游戏蛮牛游戏开发中
48B
RPG游戏《黑暗之光》Unity开发教程及素材下载
2018-03-18《黑暗之光》教程以及素材包,Unity版本4.6.9.开发步骤详情参见视频或本人博客。
147B
unity游戏开发教程.txt
2020-03-20unity3d游戏开发视频教程,资源搜索不易,链接挂了请私信楼主补链接! unity3d游戏开发视频教程,资源搜索不易,链接挂了请私信楼主补链接! unity3d游戏开发视频教程,资源搜索不易,链接挂
5.5MB
Unity4.x 2D游戏开发基础教程(内部教程)
2014-06-16Unity4.x 2D游戏开发基础教程(内部教程)没接触过Unity?写过程序但是没编写过游戏?学过C但是没学过C#?这些都没关系!!!玩过打飞机吧,玩过连连看吧,30天时间,这本资料可以让你熟悉Un
-
博客
es基础-查询
es基础-查询
-
下载
S7-200常用问题.rar
S7-200常用问题.rar
-
学院
2021最新Kubernetes(k8s)集群实战精讲
2021最新Kubernetes(k8s)集群实战精讲
-
学院
Java学习路线,好的学习路线和好的方法,能让我们少走些弯路
Java学习路线,好的学习路线和好的方法,能让我们少走些弯路
-
博客
Leetcode 291. Word Pattern II
Leetcode 291. Word Pattern II
-
学院
FFmpeg4.3黄金系列课程:c++版
FFmpeg4.3黄金系列课程:c++版
-
学院
pyechart数据可视化
pyechart数据可视化
-
博客
DQL语言-子查询
DQL语言-子查询
-
下载
串口监测AccessPort137.rar
串口监测AccessPort137.rar
-
下载
专利挖掘、撰写与转化应用
专利挖掘、撰写与转化应用
-
学院
【数据分析-随到随学】Spark理论及实战
【数据分析-随到随学】Spark理论及实战
-
博客
Android-UI-03-图形绘制-Canvas-drawable案列
Android-UI-03-图形绘制-Canvas-drawable案列
-
学院
SubstancePainter插件开发-基础入门
SubstancePainter插件开发-基础入门
-
学院
基于X210的裸机时钟温度显示器-第3/3季
基于X210的裸机时钟温度显示器-第3/3季
-
下载
竟斗云2.0编程器固件OPBOOT_1.1.2.BIN
竟斗云2.0编程器固件OPBOOT_1.1.2.BIN
-
学院
跟我练内测小分队学习礼包
跟我练内测小分队学习礼包
-
学院
【2021】UI自动化测试Selenium3
【2021】UI自动化测试Selenium3
-
下载
海思IVE_SVP_IVS开发手册.zip
海思IVE_SVP_IVS开发手册.zip
-
学院
23种JAVA设计模式
23种JAVA设计模式
-
学院
【数据分析-随到随学】SPSS调查问卷统计分析
【数据分析-随到随学】SPSS调查问卷统计分析
-
学院
(新)备战2021软考网络工程师培训学习套餐
(新)备战2021软考网络工程师培训学习套餐
-
下载
最新版windows mysql-8.0.23-winx64.zip
最新版windows mysql-8.0.23-winx64.zip
-
博客
Optimization Week 5: Duality example
Optimization Week 5: Duality example
-
学院
单元测试UnitTest+Pytest【Selenium3】
单元测试UnitTest+Pytest【Selenium3】
-
下载
结构力学建模(COMSOL)
结构力学建模(COMSOL)
-
博客
图像语义分割 -- FCN
图像语义分割 -- FCN
-
博客
variogram(变异函数)、structure function、covariance、variance的区别与联系
variogram(变异函数)、structure function、covariance、variance的区别与联系
-
学院
微信支付2021系列之扫码支付一学就会java版
微信支付2021系列之扫码支付一学就会java版
-
学院
【数据分析-随到随学】Tableau数据分 析+PowerBI
【数据分析-随到随学】Tableau数据分 析+PowerBI
-
博客
DQL语言-分页查询
DQL语言-分页查询