《杜增强讲Unity之Tanks坦克大战》1-准备工作
0.案例介绍
0.1开始界面
![](https://upload-images.jianshu.io/upload_images/9047377-3fa3e4b51b342d3a.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/908/format/webp)
点击Play Now 进入游戏界面
![](https://upload-images.jianshu.io/upload_images/9047377-c6eea0facb985f40.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/908/format/webp)
左边的坦克使用ws控制前后移动,ad键左右旋转,空格键开火
![](https://upload-images.jianshu.io/upload_images/9047377-6c2041be64d7332c.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/907/format/webp)
右边的坦克使用方向键上下控制前后移动,方向键左右键实现左右旋转,enter键开火
![](https://upload-images.jianshu.io/upload_images/9047377-e57043d90c26e1db.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/907/format/webp)
1.准备工作
本案例需要unity5.2以上版本.
素材为Tanks Tutorial.unitypackage
1.1新建3d项目
![](https://upload-images.jianshu.io/upload_images/9047377-bb577b030da3f20b.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/907/format/webp)
点击unity右上角的Layout将布局方式切换为2by3
![](https://upload-images.jianshu.io/upload_images/9047377-b75f1c57aea9d416.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/907/format/webp)
拖动Project面板到Hierarchy面板下方
![](https://upload-images.jianshu.io/upload_images/9047377-6f0753a25653c633.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/907/format/webp)
点击Project右上角下拉按钮,切换为One Column Layout模式
设置完成之后,unity界面如下
![](https://upload-images.jianshu.io/upload_images/9047377-9def661b0c3223f9.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/906/format/webp)
1.2导入素材.
使用菜单Assets->Import Package->Custom Package
浏览到素材所在文件夹
点击打开
![](https://upload-images.jianshu.io/upload_images/9047377-298178890e2bd6a7.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/907/format/webp)
点击Import,导入全部素材
![](https://upload-images.jianshu.io/upload_images/9047377-d6af168b85a6e8e2.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/907/format/webp)
点击 即可打开游戏场景.
![](https://upload-images.jianshu.io/upload_images/9047377-a20ec552e0aa9e6c.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/906/format/webp)
点击Play按钮 即可开始运行游戏
![](https://upload-images.jianshu.io/upload_images/9047377-bf3a101361929dda.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/907/format/webp)
点击 Game场景里面的PLAY NOW预览游戏最终实现效果
![](https://upload-images.jianshu.io/upload_images/9047377-ca51d0acce0e91f8.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/908/format/webp)
到此为止,本节准备工作已全部完成,下节开始游戏场景的设置.
---------------------------我是目录分割线---------------------------
《杜增强讲Unity之Tanks坦克大战》4-坦克的移动和旋转
《杜增强讲Unity之Tanks坦克大战》9-发射子弹时蓄力
《杜增强讲Unity之Tanks坦克大战》11-游戏流程控制
/// <-----------summary----------->
/// < ---------杜增强的博客--------->
/// < -专注于Unity游戏,VR/AR开发->
/// <-----------summary----------->