unity ui 概述

If you're shopping around for a 2D game engine, you've undoubtedly come across Unity. Dipping your toe into Unity's editor can be overwhelming if you haven't had a good overview of where all of the tools live, particularly if it's also your first time using C# to write scripts.

如果您正在逛逛2D游戏引擎,那么您无疑会遇到Unity 。 如果您对所有工具的用途都没有很好的了解,那么将脚趾浸入Unity的编辑器中可能会感到不知所措,尤其是这也是您第一次使用C#编写脚本时。

In this article, I'll give you a tour of Unity's 2D features with an overview of what tools you'll need to create a platformer - or any kind of 2D game - and where to find them in the editor!

在本文中,我将向您介绍Unity的2D功能,并概述创建平台游戏或任何类型的2D游戏所需的工具以及在编辑器中的查找位置!

If you're considering Unity among other 2D game engines, take a look at this article for some options.

如果您正在考虑在其他2D游戏引擎中使用Unity,请查看本文中的一些选项。

And if you'd prefer a visual tour of Unity, check out this video instead (28 minute watch):

而且,如果您希望对Unity进行视觉浏览,请观看以下视频(观看28分钟):

In this overview, we'll be using the Warped City Unity Assets Pack by Ansimuz.

在此概述中,我们将使用Ansimuz的Warped City Unity Assets Pack 。

总览 (Overview)

On first glance, Unity's editor will look familiar if you've used another "all-in-one" game engine, but if it's your initial entrée into game development, it might be overwhelming.  Moreover, if you don't already have some experience working in C#, I highly recommend doing some tutorials using Microsoft's .NET or similar.  Unity has a relatively steep learning curve, and if you can come to it with some basic proficiency with C#, you'll have an easier onboarding experience.

乍一看,如果您使用了另一个“多合一”游戏引擎,Unity的编辑器就会看起来很熟悉,但是如果您是初次进入游戏开发领域,那么它可能会令人不知所措。 此外,如果您还没有使用C#的经验,我强烈建议您使用Microsoft的.NET或类似版本进行一些教程。 Unity的学习曲线相对较陡,如果您对C#有一定的基本了解,那么您将获得更轻松的入门经验。

A lot of your time will be spent in the hierarchy (1), which allows you to keep track of all of your game objects in a given "scene," which is a specific portion of your game (like your "Start" menu or a particular game world in your platformer).  With it, you can nest objects under others, manage your cameras and canvasses, and navigate through all of the game objects you've created.

您的很多时间都花在了层次结构(1)上,这使您可以在给定的“场景”中跟踪所有游戏对象,“场景”是游戏的特定部分(例如“开始”菜单或平台游戏中的特定游戏世界)。 借助它,您可以将对象嵌套在其他对象之下,管理相机和画布,以及浏览所有已创建的游戏对象。

You'll want to keep organized in your project tab (2), which acts as a file system that you can structure as you see fit.  One best practice, for example, is to collect all of your assets in one folder, animations in another, scripts in yet another, and so forth.  You can also click over to the console tab if you've instructed Unity to log stuff under circumstances that you dictate.

您需要在项目选项卡(2)中保持井井有条,该选项卡充当文件系统,您可以根据需要进行构建。 例如,一种最佳实践是将所有资产收集在一个文件夹中,将动画收集在另一个文件夹中,将脚本收集在另一个文件夹中,依此类推。 如果已指示Unity在您指定的情况下记录内容,则也可以单击“控制台”选项卡。

When clicking on a game object, either in the hierarchy or project tab, you'll be greeted with more details in the inspector (3).  These details will depend on what kind of object you've clicked, and what you've attached to that game object.  If you've created an empty game object, for example, there won't be much there.  But if you've made a player character that has a a sprite attached, along with an animation controller, rigidbody2d to manage physics, collider2d to manage collisions, and a script to manage user input and interactivity, all of these will appear in the inspector for you to tinker with.

在层次结构或项目选项卡中单击游戏对象时,将在检查器中看到更多详细信息(3)。 这些详细信息将取决于您单击了哪种对象以及您对该游戏对象附加的对象。 例如,如果您创建了一个空的游戏对象,那里将没有太多。 但是,如果您制作了一个附加了精灵的播放器角色,一个动画控制器,用于管理物理的“刚体2d”,用于管理碰撞的“ collider2d”以及用于管理用户输入和交互性的脚本,则所有这些都将显示在检查器中,用于你去修补。

The rest of the real estate within the editor is taken up by the scene itself (4), which is where you'll build your game world, drop in objects and triggers, and go about your game designing.  You can click over to the game tab to see what your game actually looks like when played (and play it by hitting the "play" button), or check out the Asset Store from the safety of your Unity client.

编辑器中的其余空间由场景本身(4)占用,您可以在其中构建游戏世界,放置对象和触发器,并进行游戏设计。 您可以单击到游戏选项卡,以查看玩游戏时的实际外观(并通过单击“播放”按钮来玩游戏),或者从Unity客户端的安全性中签出Asset Store。

在哪里可以找到动画师之类的东西 (Where to Find Things Like the Animator)

If you've read any of my writing about game engines, you've heard me whinge about Unity's 2D support being shoehorned into a 3D environment, and about how difficult it can be to locate the tools you need to get your work done.

如果您读过我有关游戏引擎的任何文章 ,您就会听到我对Unity的2D支持陷入3D环境中以及如何找到完成工作所需的工具有多困难的抱怨。

Let's just say that some things are difficult to accomplish in Unity compared to other 2D game engines, but they're all still possible.  If you're attempting to access the animator, for example, you'll need to select the Window > Animation > Animator, which is different from the location of the animations that you'll painstakingly create and save in your project tab.

我们只能说,与其他2D游戏引擎相比,在Unity中有些事情很难完成,但它们仍然可以实现。 例如,如果尝试访问动画师,则需要选择“窗口”>“动画”>“动画师”,这您要精心创建并保存在项目选项卡中的动画的位置不同

Similarly, if you want to access Physics 2D settings, by all means, click on Edit > Project Settings, which are different from your personal preferences, located under Edit > Preferences.  And if you're looking to tinker with builds, you'll want to go to File > Build Settings.

同样,如果您想访问Physics 2D设置,请务必单击“编辑”>“项目设置”,该设置与您的个人首选项不同 ,位于“编辑”>“首选项”下。 而且,如果您想修改构建,则需要转到“文件”>“构建设置”。

Similarly, if you just want to create a plain ol' game object, head to GameObject > Create Empty (or 2D Object if you know what you're looking for).  If, conversely, you're trying to add a rigidbody to an existing game object, you'll need to go to Component > Physics 2D > Rigidbody 2D (or click "Add Component" in the inspector when you have the game object selected in the hierarchy).

同样,如果您只想创建一个普通的游戏对象,请转到“游戏对象”>“创建空对象”(如果知道要查找的内容,则为2D对象)。 相反,如果您想向现有游戏对象添加刚体,则需要转到“组件”>“物理2D”>“刚体2D”(或在检查器中选择“添加组件”时,在层次结构)。

I think it's clear by this point that finding the things that you'll need to get your work done can be complicated, nested as they are within different menus.  It doesn't help that some of the tools themselves, such as the animator, are clunky compared to their counterparts in other 2D game engines, but once you get a handle on how they work, you'll find them to be perfectly serviceable.

我认为到这一点很明显,找到完成工作所需的东西可能很复杂,因为它们位于不同的菜单中。 与其他2D游戏引擎中的某些工具相比,某些工具本身(例如动画器)笨拙,这无济于事,但是一旦掌握了它们的工作原理,便会发现它们可完美使用。

Visual Studio和C脚本 (Visual Studio and C Scripting)

Unity supports C# for writing scripts, and you can pair it with Visual Studio for a relatively painless integrated development environment.

Unity支持C#编写脚本,您可以将其与Visual Studio配对以实现相对轻松的集成开发环境。

Scripts are easily accessible through the editor, and you'll have to attach them to your game objects to make your game do pretty much anything.  One fun feature is to declare a public variable in a script - say, an integer called "jumpSpeed" - and then attach that script to a game object in the inspector.  You'll see that variable exposed in the Unity editor, and can change it on the fly while your game is running to see how your changes work in action.

脚本可以通过编辑器轻松访问,并且您必须将它们附加到游戏对象上,以使您的游戏几乎可以执行任何操作。 一个有趣的功能是在脚本中声明一个公共变量(例如,称为“ jumpSpeed”的整数),然后将该脚本附加到检查器中的游戏对象。 您将在Unity编辑器中看到该变量,并且可以在游戏运行时即时对其进行更改,以查看所做更改的作用。

预制件 (Prefabs)

Finally, Unity leverages the use of what they call "prefabs" to streamline your workflow.  In essence, a prefab is a type of reusable object that you've created so that you can drop it in your game world again and again without the need for repeat customization.

最后,Unity利用他们所谓的“预制件”来简化您的工作流程。 本质上,预制是您创建的一种可重复使用的对象,因此您可以一次又一次地将其放到游戏世界中,而无需重复自定义。

Let's say that you create a monster in your top-down 2D adventure game as an empty game object, then attach a sprite, rigidbody2d, collider2d, animations, and a controller script.  You can drag that monster into your project tab to make it a prefab, which allows you to use it again and again in your game world without having to go through the whole process every time.

假设您在自上而下的2D冒险游戏中创建了一个怪物作为空游戏对象,然后附加了一个精灵,僵尸2d,碰撞器2d,动画和控制器脚本。 您可以将该怪物拖到项目选项卡中以使其成为预制件,从而使您可以在游戏世界中一次又一次地使用它,而不必每次都经过整个过程。

Unity has several more features that support 2D game development, some of which I cover in the video above, and it would do to watch a few tutorials on specific aspects of the editor if you're considering using it for your next game.  I'd particularly recommend brushing up on C# before tackling the editor itself, as doing so will provide for a more gentle learning curve.

Unity还有更多支持2D游戏开发的功能,我在上面的视频中介绍了其中一些功能,如果您考虑将其用于下一款游戏,那么它将观看一些有关编辑器特定方面的教程。 我特别建议在处理编辑器本身之前先复习C#,因为这样做可以提供更平缓的学习曲线。

Hope this overview is helpful for your next game!

希望本概述对您的下一个游戏有所帮助!

If you enjoyed this article, please consider checking out my games and books, subscribing to my YouTube channel, or joining the Entromancy Discord.

如果您喜欢这篇文章,请考虑查看我的游戏和书籍 , 订阅我的YouTube频道或加入Entromancy Discord 。

M. S. Farzan, Ph.D. has written and worked for high-profile video game companies and editorial websites such as Electronic Arts, Perfect World Entertainment, Modus Games, and MMORPG.com, and has served as the Community Manager for games like Dungeons & Dragons Neverwinter and Mass Effect: Andromeda. He is the Creative Director and Lead Game Designer of Entromancy: A Cyberpunk Fantasy RPG and author of The Nightpath Trilogy. Find M. S. Farzan on Twitter @sominator.

法赞(MS Farzan)博士 他曾为知名的视频游戏公司和编辑网站(例如,Electronic Arts,Perfect World Entertainment,Modus Games和MMORPG.com)撰写和工作,并曾担任《龙与地下城:龙骨无双》和《 质量效应:仙女座》等游戏的社区经理。 。 他是《 Entronancy:Cyber​​punk Fantasy RPG》的创意总监和首席游戏设计师,并且是《 The Nightpath Trilogy》的作者。 在Twitter @sominator上找到MS Farzan 。

翻译自: https://www.freecodecamp.org/news/take-a-tour-of-unity-2d/

unity ui 概述

unity ui 概述_通过此概述了解Unity 2D和Platformer基础知识相关推荐

  1. unity ui框架_[教程汇总+持续更新]Unity从入门到入坟——收藏这一篇就够了

    ----------------塔防(更新中),作者重写了基础篇(下方目录为:1.1(新) 基础)目前还在持续连载了5篇,因为不多我们更新完就能追到原作者的进度了------------------- ...

  2. unity ui插件_用Unity制作GalGame/视觉小说游戏的模型素材与插件推荐

    本文推荐一些用于开发GalGame或者视觉小说(Visual Novel)游戏的音频素材.Unity插件.3D模型.动作动画和2D素材. 一:音频资源 Cute Romantic Music Pack ...

  3. activiti 功能概述_子串功能概述

    activiti 功能概述 The requirement of data refactoring is very common and vital in data mining operations ...

  4. unity ui框架_用unity制作简单的太空游戏(2)-简单炮台

    多铆蒸刚,炮塔至大! 亿万星辰,亿万炮塔! 多铆蒸刚,炮塔至上! 亿万炮塔,亿万荣光! (PS:我没有咕咕咕,就是比较惨,一口气出了半个月的差,人瘦了,也黑了,心塞塞--赶紧写个文章压压惊--) 这一 ...

  5. unity 彩带粒子_超级技术贴:Unity粒子遇上着色器,引爆视觉特效

    下面来分析粒子系统驱动的数据,Michał使用粒子的尺寸(Size)和颜色(Color)来控制一些着色器参数.为了更好的进行参数调整,MeltingObject脚本除了引用了"熔化" ...

  6. unity 裙子摆动_随风摆动的草丛——Unity shader graph 2D初探

    效果预览 话不多说先上图. 树木,高草,顶棚与草地细节部分的动效均为着色器效果 具体实现: 右键在新标签页中打开图片查看细节 基本思路:核心是使用Tiling And Offset节点与Gradien ...

  7. python单词统计、给定一个段落()_数训营第一课笔记:Python基础知识

    1.help()和dir()函数 help()函数与dir()函数都是帮助函数: help()函数能够提供详细的帮助信息,dir()函数仅是简单的罗列可用的方法. 2.基础数据结构 基础数据类型:数值 ...

  8. hazelcast 使用_使用HazelCast进行Hibernate缓存:JPA缓存基础知识

    hazelcast 使用 HazelCast的最大功能之一就是对Hibernate第二级缓存的支持 . JPA具有两个级别的缓存. 一级缓存在事务期间缓存对象的状态. 通过两次查询相同的对象,您必须获 ...

  9. 中音萨克斯指法表图_初学萨克斯一定要了解这6点基础知识

    萨克斯管是一种色彩性很强的乐器,它的声音独特,带有神秘的色彩,音色十分迷人,是一种比较接近人声特点的乐器,因此吸引到越来越多的人喜欢上萨克斯.那么新手在初学阶段关于萨克斯一定要了解这6点基础知识. 一 ...

最新文章

  1. js markdown chart flow
  2. 深入理解 JavaScript Function
  3. 用requests获取网页源代码 python-手把手教你利用爬虫爬网页(Python代码)
  4. Linux部署禅道环境
  5. SAP 电商云 Spartacus 5_0.md 迁移文档的编写格式
  6. mysql rr 更新失败_RR 级别下 update 操作的是快照读还是当前读?
  7. python核心编程:杂记2
  8. [状压dp][剪枝搜索] 洛谷 P2831 愤怒的小鸟
  9. Android jetpack-DataStore
  10. 必修三计算机选修三知识点总结,高中生物必修一、必修二、必修三、选修三知识点总结(人教版).pdf...
  11. JS中更改样式属性或者更改类名
  12. 快速将英文PDF翻译为中文
  13. 移远百科 | GNSS定位技术知多少
  14. 关于几种获取iOS设备UDID典型方式的技术探讨
  15. android版本高低有啥好处与不好,WP跟安卓比流畅 但为什么就不好用呢?
  16. 软工网络15团队作业4——Alpha阶段敏捷冲刺之Scrum 冲刺博客(Day4)
  17. nmap 扫描 STATE 显示closed
  18. 用c++随机生成10小学生算术题的课设
  19. android背光,Android背光亮度调节
  20. 自定义UTI 注册你的APP所支持的文件类型

热门文章

  1. 【论文发表】不收版面费和审稿费的期刊汇总
  2. 编程语言那么多,为何建议学习python呢?
  3. 【JZOJ 省选模拟】6707.异或树(xor)
  4. 关于自己项目(听书系统)的简介
  5. 什么是 immutable
  6. 获取list集合中重复的元素
  7. 谷歌云服务器如何通过Putty/SecureCRT远程登录
  8. uV胶点胶机器人_高点涂胶机器人
  9. uniapp显示富文本
  10. 什么是进程?什么是线程?进程与线程的区别?