Unity3D說明文檔翻譯-Gameplay in 2D

Gameplay in 2D

2D上的遊戲

While famous for its 3D capabilities, Unity can also be used to create 2D games. The familiar functions of the editor are still available but with helpful additions to simplify 2D development.

雖然它以3D著稱,Unity也可以被用於創建2D遊戲.編輯器的常用功能依然可用但補充了些有助簡化2D開發.

Scene viewed in 2D mode

2D模式場景視圖

 

The most immediately noticeable feature is the 2D view mode button in the toolbar of the Scene view. When 2D mode is enabled, an orthographic (ie, perspective-free) view will be set; the camera looks along the Z axis with the Y axis increasing upwards. This allows you to visualise the scene and place 2D objects easily.

大部分顯而易見的特性是2D視圖模式按鈕在場景視圖上的工具條.當2D模式激活,一個正交(即,免除透視)模式將被設置.攝像機正對着Z軸而Y軸向上增長.這允許你方便的顯現場景和放置2D對象.

For a full list of 2D components, how to switch between 2D and 3D mode, and the different 2D and 3D Mode settings, see 2D or 3D Projects.

一個完整的2D組件列表,如何在2D和3D模式間切換,2D和3D模式的不同,參考2D或3D項目.

2D Graphics

2D圖形

Graphic objects in 2D are known as Sprites. Sprites are essentially just standard textures but there are special techniques for combining and managing sprite textures for efficiency and convenience during development. Unity provides a built-in Sprite Editor to let you extract sprite graphics from a larger image. This allows you to edit a number of component images within a single texture in your image editor. You could use this, for example, to keep the arms, legs and body of a character as separate elements within one image.

2D圖形對象被稱爲精靈.精靈本質上僅是標準紋理但有些特殊技術在開發期間方便而有效的組合和管理精靈紋理.Unity提供一個內建的精靈編輯器以讓你從一張大圖抓取精靈圖形.這允許你在你的圖片編輯器上通過一張單個貼圖上編輯許多組件圖片.你可以使用這,如,保持角色的手臂,腿和身體作爲分離的元素在一張圖片內.

Sprites are rendered with a Sprite Renderer component rather than the Mesh Renderer used with 3D objects. You can add this to a GameObject via the Components menu (Component > Rendering > Sprite Renderer )or alternatively, you can just create a GameObject directly with a Sprite Renderer already attached (menu: GameObject > 2D Object > Sprite).

精靈使用精靈渲染器組件渲染而不是3D對象使用的網格渲染器.你可以給一個對象通過組件菜單添加它(組件>渲染>精靈渲染)或者,你可以僅直接創建一個遊戲對象且已附加上精靈渲染器(菜單:遊戲對象>2D對象>精靈).

In addition, you can use a Sprite Creator tool to make placeholder 2D images.

另外,你可以使用一個精靈創建器工具製作站位2D圖片.

2D Physics

2D物理

Unity has a separate physics engine for handling 2D physics so as to make use of optimizations only available with 2D. The components correspond to the standard 3D physics components such as RigidbodyBox Collider and Hinge Joint, but with “2D” appended to the name. So, sprites can be equipped with Rigidbody 2DBox Collider 2D and Hinge Joint 2D. Most 2D physics components are simply “flattened” versions of the 3D equivalents (eg, Box Collider 2D is a square while Box Collider is a cube) but there are a few exceptions.

Unity有一個處理2D物理的單獨的物理引擎以利於只適合在2D模式下的優化.與3D物理組件相似的組件如剛體,碰撞器盒子和樞紐關節,但添加了2D到名字上.因此,精靈可以裝配剛體2D,碰撞器盒子2D和樞紐關節2D.大部分2D物理組件僅僅是平面版本的3D同等物(如,碰撞器2D是一個正方形而碰撞器是一個立方體)但也有些例外.

For a full list of 2D Physics components, see 2D or 3D Projects. See the Physics section of the manual for further information about 2D physics concepts and components.

2D物理組件完整列表,參考2D或3D項目.查看手冊的物理學部分獲取更多關於2D物理概念和組件的詳細信息.

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章