未登录,请登录后再发表信息
最新评论 (0)
播放视频

Unity 5 官方教程 #8 - 构建游戏

Unity 5 - Roll a Ball game - 8 of 8: Building the Game - Unity Official Tutorials

Now that we’ve finished our game we need to present it to our players.
现在完成了游戏 需要将其发布
One of the greatest things about Unity is that once we’ve created our game,
Unity的最大特性之一是 一旦创建了游戏
we can deploy it to many of the current platforms.
就能在当前众多的平台上发布
For more detailed information on building and build targets,
更多关于生成及构建目标的细节
please see the lesson linked below.
请关注下方链接课程
Before we build our game, we should save our scene.
在构建游戏之前需要先保存场景
To build our game, we must first open the Build Settings window.
要构建游戏 首先必须打开Build Settings(构建设置)窗口
We can do this by selecting File > Build Settings
可以通过选择File菜单下的Build Settings打开
or by using the key combination of Shift + Command or CTRL + B.
或者使用Shift+Command或Ctrl+B组合键
This brings up the Build Settings window.
这样就打开了Build Settings窗口
Our current build target is indicated by the Unity logo.
当前构建目标会带有Unity图标
The blue highlight indicates our focus,
蓝色高亮表明所选项
and shows us on the right-hand side the build options for the currently selected platform.
右侧展示了当前所选平台的构建选项
We want to build a standalone application.
我们想要构建一个独立应用程序
This is our current build target:
这是当前的构建目标
PC, Mac and Linux Standalone.
PC Mac和Linux单机版本
We do not need to change our build target.
无需改变构建目标
If we did want to change our build target,
如果想要改变构建目标
we can select the desired platform from the list,
可以在列表中选择想要的平台
and click the Switch Platforms button at the bottom of the window.
然后点击窗口底部的Switch Platforms(转换平台)按钮
Let’s now return our build target to the standalone player.
现在将构建目标返回到单机版播放器
Once we have selected our new build target,
一旦选择好了新的构建目标
we need to add the scenes we want to build to the Build Settings window.
需要将想要构建的场景添加至Build Settings窗口中
We can add the current scene by clicking the Add Current button,
可以点击Add Current按钮添加当前场景
or we can drag and drop any scene from our Project view
也可以从项目视图中拖拽出任何场景
into the field at the top of the Build Settings window.
添加至Build Settings窗口的顶部区域
It’s worth noting that we don’t need to include every scene in our project.
需要注意的是 无需将所有场景都添加到项目中
We only need to include the scenes we want in our game.
只需添加想要呈现在游戏中的场景即可
It is also possible to perform a build with no scenes in the Build Settings window.
Build Settings窗口没有场景也能进行构建
If we do this,
如过这样做
Unity will simply build our game using the current scene we have open for editing.
Unity只会用当前打开的编译场景构建游戏
Now we are ready to build our game.
现在经常准备好构建游戏了
Let’s return to the Build Settings window, and click the Build button.
回到Build Settings窗口 点击Build按钮
This will bring up a dialogue box asking us to choose a build location.
就会弹出一个对话框 询问生成位置
I like to associate my build location with my project,
我喜欢把生成位置和项目关联起来
so I will create a new folder inside my project called Builds.
因此我会在项目中新建一个名为Builds的文件夹
This folder must be placed only on the root of our project
这个文件夹必须放在项目的根目录下
alongside the assets and library folders.
与assets和library文件夹同级
With the build folder selected let’s name the build
选中新建的文件夹 命名生成文件
and then click Save.
然后点击保存
Unity will now build the application and save it to our Builds folder.
Unity现在将生成应用 并保存至Builds文件夹
When building for the Mac, Unity builds a app bundle,
构建Mac版本时 Unity会生成应用程序包
which contains all of the relevant data and files.
其中包含了所有的相关数据及文件
When building for Windows,
构建Windows版本时
Unity builds a exe file
Unity会生成exe文件
and a data folder which contains all of the necessary resources.
以及一个包含了所有必要资源的数据文件夹
To run the game, simply run the executable application.
要运行游戏 只需运行这个可执行文件
And now we are running our game.
现在游戏就运行了
And…
然后……
we win!
我们赢了
So in these assignments we have learned how to create new game objects,
在本系列任务中 我们学习了如何新建游戏对象
how to position them in the scene,
如何在场景中布置它们
add new components to them,
为其添加新的组件
write our own custom behaviors for them using simple scripting.
通过编写简单脚本 自定义游戏行为
We’ve seen how to use Lights, Cameras, Colliders, Triggers, Rigidbodies.
了解了如何使用光源 摄像机 碰撞器 触发器以及刚体
We can collect and count objects.
还可以收集和统计游戏对象
Though this is a very simple example,
尽管这是个非常简单的例子
it covers a large set of basic subjects important to understanding how to use Unity.
却涵盖了大部分基本模块 这对理解如何使用Unity至关重要
For continued learning about Unity,
欲继续学习更多关于Unity的课程 任务和项目
check the Learn site for more lessons, assignments and projects.
请点击访问Learn网站

发表评论

译制信息
视频概述

用Unity制作好游戏后如何编译为各种平台的发布版本呢?来看看吧

听录译者

樱木花道

翻译译者

剧透、

审核员

审核员TOP

视频来源

https://www.youtube.com/watch?v=hSg3e1M3hKY

相关推荐