1.3理解和布局unity的用户界面
unity技术Thepoly 14375 0
实名

通过了实名认证的内容创造者

发布于 2022-3-24 15:09:07

您需要 登录 才可以下载或查看,没有账号?注册

x
本帖最后由 Thepoly 于 2022-3-24 20:17 编辑

            src=http___xqimg.imedao.com_17b70f518351426d3fd73b36.png!800.jpgrefer=http___xqimg.imedao.webp.jpg
174551k9r66ex7z719e99h.jpg

         
Hello,大家好。
本内容有Kinglary分享
游戏引擎相关内容
1.3理解和布局unity的用户界面
1.3Understanding and optimizing the User Interface

Game engines, especially 3D-capable ones, can be a bit intimidating the first time you open them. Although Unity is particularly intuitive, user-friendly, and well documented, we have provided this recipe to show you how to operate inside its User Interface (UI).
前言:游戏引擎,尤其是3D游戏引擎,当你第一次打开他们的时候可能感觉有点吓人。但是,unity是一款非常直观、界面十分友好、功能齐全的3D游戏引擎。在这一环节中,我们将向你提供操作unity用户界面的秘诀。
How to do it (如何去做)
Let's take a look at Unity's user interface:
首先,让我们看一下unity用户界面布局吧:

1.Run Unity.Unless you have previously changed it,its layout should initiate in wide mode.Access Window | Layouts and choose another option,such as 4 Split or 2 by 3,and notice how the interface is organized into Views:
1.运行unity时,除非你事先改动过它,不然他是默认的“wide”布局模式下的。点击windows | layout选择其他选项,比如“4 split”或者“2 by 3”,观察一下不同模式下窗口是如何重新组织的:
图1.1 unity3D引擎的默认界面
图1.2 unity3D 4 Split界面
Let's take a look at those views:
我们可以看到如下这些窗口:
Scene: This view is used to position, rotate, scale, and select game objects,and also navigate your level.
场景(场景面板,快捷键Ctrl+1):这个视窗,用于定位、旋转、缩放和选择游戏对象(Game Object),也在本窗口中搭建和设计你的游戏关卡。
Game: This is the place to play and test your game. It will reproduce theplayer's experience as accurately as possible.
游戏(游戏面板,快捷键Ctrl+2):这个面板主要是用来运行和测试你的游戏,这里将尽可能准确的再现玩家的游戏体验。
Hierarchy: Game objects (as diverse as characters, cameras, level geometry,lights, and even GUI textures) placed in our scene will be listed here.
层级(层级面板,快捷键Ctrl+4):放置在游戏场景中的所有游戏对象(Game Object,简称GO:无论是人物角色、摄像机、关卡、灯光还是GUI贴图,游戏中的一切具体内容全是游戏对象)将罗列展示在这里。
Project: This is where you create, organize, and access your game assets.From 3D models and 2D textures to C# scripts and Prefabs, every re-usable element will be listed here.
项目(项目面板/项目浏览器,快捷键Ctrl+5):这里用于创建、组织和获取你的游戏资源。从3D模型、2D贴图到C#脚本和预设项目,每一个可以使用到的元素都将会在这里展示出来。
Inspector: From the Inspector, you can configure any game objects (selectedfrom the Hierarchy view) or assets (selected from the Project view). That includes changing its Transform settings, configuring existing components and attaching new ones. Also, you can adjust other preferences for your game, once you have accessed them from the menu, in the Inspector view.
检视(检视面板,快捷键Ctrl+3):在检视面板中,你可以直接设定一切游戏对象或资源的属性。包括坐标位置设定、定义和添加新的附加组件等等。在检视面板中,当你已经从菜单栏中设置了一些附加组件,你也可以根据你的游戏,调整或修改为其他的附加组件。
Toolbar: Includes transform tools (used for manipulating game objects and navigating the scene), control tools (used for playing / pausing and stopping the level), and drop-down tools (used for managing layers and layouts).
工具栏:包括变换工具(用于操控游戏项目和导航游戏场景);
控制工具(用于运行、暂停和停止游戏关卡);
下拉工具(用于编辑层和布局);
变换Gizmos切换工具(第一个是切换轴心点;第二个是切换局部或全局坐标)
Menu: Gives access to a diverse list of commands covering asset import/export, preferences setting, game object creation, components, terrain,layout, and documentation.
菜单栏:提供一系列指令的列表,包括导入/导出、首选项设定、游戏对象创建、附件、地形、布局和操作记录等。

2. If you want to customize the layout any further, drag and drop the views to relocate and/or dock them.
2.如果你想调整你的界面布局,可以直接将各个面板拖拽出来在重新定位他们。

3. If you like your custom layout, save it through the Window | Layouts | Save Layout... menu.
3.你想保存当前界面布局的话,在菜单中,点击 Window | Layouts | Save Layout... menu进行保存。

4. When testing your game, it might be a good idea to check the Maximize on Play button, in the Game view. Also, if you work with more than one display monitor,you could drag the Game view into the second display, leaving a display exclusively for the Editor.
4.当你在游戏面板中测试你的游戏时,点击该窗口中的“Maximize on Play”是个很好的主意。当然,如果你想运行多个监视器(Display Monitor),你可以将游戏面板拖拽到其他监视器中,在unity编辑器中留下特定的那个监视器。在如图所示位置(Display1)
图2 Display
5. You can also adjust the Game view resolution. It's a good idea to test your game running on its standard standalone resolution and every supported aspect ratio.
5.你也可以调节游戏视窗的分辨率。在标准的Standalone模式下和所支持的宽高比下进行游戏测试,是不错的选择。(调节测试宽高比的位置如下图)
图3 Standalone模式及宽高比调节
6. In case you want to check the graphics performance of your game during testing,you should turn on the Stats button .
6.如果在游戏测试的过程中,你想检查图形计算和其他运算性能(比如帧率),你可以打开Stats按钮。位置如下图:
图4.1 Stats位置
图4.2 统计显示面板
7. Finally, activate Gizmos if you want them to be drawn at runtime, making it easier to spot rays, colliders, lights, cameras, and so on in your scene, as shown here:
7.如果你想在游戏运行的时候,显示辅助线框,请点击Gizmos,如下图所示位置。这会让你在你的游戏场景中,轻松的分辨出射线、碰撞体、灯光、摄像机和其他的游戏对象。

8. There is another view you should pay attention to: the Console view. Access it by navigating to Window | Console. This is a very important view when it comes to debugging your game, as it displays errors, warnings, and other debug output during testing.
8.这里有另一个面板需要注意:Console面板。在菜单栏中,点击Windows | Console就会将该面板调出。在你调试你的游戏时,这个面板非常重要。在测试期间,这个面板将输出你游戏中存在的错误、警告(不是致命错误但是在运行时可能出现不可预测的问题的地方)和其他问题解决方案。

9. Another interesting view (for those with Unity Pro) is the Profiler (Window | Profiler),where you can check out detailed statistics of your game performance in real time.
9.还有一个有趣的面板就是Profiler(Windows/Profiler,unity5非PRO版本也已经有了该功能)获得,他可以在你游戏测试的过程中,动态的实时展示一些数据细节。

附录:unity的基本操作
A.按鼠标右键进入飞行模式,并点WASD键(Q和E键为上下)快速进入第一人称预览导航。
B.选择任意游戏对象按F键,这会让选择的对象最大化显示在场景视图中心。
C.使用箭头键(上下左右)会沿X/Z/Y平面移动浏览。
D.按Alt键并鼠标左键拖拽,围绕当前轴心点动态观察。
E.按Alt键并点鼠标中键拖拽来平移观察场景视图。
F.按Alt键并点鼠标右键拖拽来缩放场景视图。和鼠标滚轮滚动作用相同。
G.在场景视图的右上角是场景Gizmo。这个显示场景相机的当前方向,并允许你快速修改视图角度
H.单击游戏对象,WER分别对应平移、旋转和缩放,和3Dmax是一致的。
I.Gizmod的每个有色的臂表示一个几何轴。你能点击任意臂设置场景相机到该轴正交视图,你能左键点击gizmo下的文字来切换透视图和等距视图。在等距视图模式,你也可以点击右键拖拽或点Alt键加鼠标左键点击来拖拽摇移视图。
J.unity三视图调出方式(重要)菜单栏/Windows/Layouts/4 Split,一般专业开发人员的经典布局4Split(如下图),可以准确定位物体,测试时,快捷键Ctrl+2就可以调出Game面板进行测试。也可以右键单击Gizmod下方文字改变视图。
图5  Gizmod
好了今天的分享就到这里,回顾这次分享我们系统的学习了Unity的面板布局和基础的功能使用。下次我们将带来预置体的创建和文件管理。

本帖被以下画板推荐:

还没有设置签名!您可以在此展示你的链接,或者个人主页!
使用道具 <
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表