close

 

Typographical Conventions
This is a long tutorial containing a lot of information. To make it easier to follow,some simple conventions are used:
 
印刷約定
這是一個長期教程包含了很多信息。為了更容易跟隨,一些簡單的約定使用:
 
Background & Tangents
Text in boxes like these contains additional information that may help clarify the main
text.
 
背景與切線
在這樣的文本框包含更多的信息可以幫助澄清主
文本。
 
Scripting code will appear as shown below:
// This is some script code.
Function Update()
{
DoSomething();
}
 
腳本代碼將出現如下圖所示:
/ /這是一些腳本代碼。
 

NOTE The scripts included in the tutorial include plenty of comments and are designed to be easy to follow. These comments are usually omitted in the code fragments in the tutorial text to save space.
注意這些腳本包括在本教程包括大量的評論和被設計成容易理解。這些意見通常省略的代碼片段在本教程的文本以節省空間。
 
Actions you need to perform within Unity are shown like this:
 
動作,你需要執行Unity 內顯示是這樣的:
 
*Click on this;
*Then this;
*Then click Play.
*按一下此;
*那麼這一點;
*然後單擊播放。
 

Script names, assets, menu items or Inspector Properties are shown in boldface text.
Conversely, a monospace font is used for script functions and event names, such as
the Update() function in the script example above.
 
腳本名稱,資產,菜單項或檢查性能以粗體顯示的文字。
相反,一個等寬字體用於腳本功能和事件名稱,如
的Update()函數在腳本上面的例子。
 
Unity Conventions
Unity is a unique development system. Most developers will be used to working in a code editor, spending 90% of their time editing code and even writing code to load up and use assets.
Unity is different: It is asset-­centric rather than code-­centric, placing the focus on the assets in much the same way as a 3D modeling application.
For this reason, it is worth understanding the key conventions and terminology unique to Unity development:
 
Unity公約
Unity是一個獨特的開發系統。大多數開發人員將用於在代碼編輯器的工作,花費90%的時間編輯代碼,甚至編寫代碼來加載和使用的資產。
Unity就是不同:它是資產為中心,而不是代碼為中心,把重點的資產在大致相同的方式作為三維建模中的應用。
基於這個原因,它是值得理解的主要公約和術語獨有的Unity的發展:
 

Projects
A game built in Unity will consist of a Project. This contains all your project’s elements,such as models, scripts, levels, menus, etc. Usually, a single Project file will contain all the elements for your game.
When you start Unity 2, the first thing it does is open a Project file. (If you have only just installed it, this will be the Project file containing the Island Demo.)
 
Projects
一個建立在Unity 的遊戲將包括一個項目。這包含了所有專案的元素,如模型,腳本,級別,菜單等通常,一個單一的項目文件將包含所有的元素你的遊戲。
當您啟動Unity 2,首先它是打開一個項目文件。 (如果你才剛剛安裝了它,這將是項目文件包含島演示。)
 

Scenes
Each Project contains one or more documents called Scenes.
A single Scene will contain a single game level, but major user-­interface elements, such as game menus,game-­over sequences or major cut-­scenes may also live in their own Scene files.
Complex games may even use entire Scenes just for initialization purposes.
Thus all levels in a game will most likely be Scenes, but not every Scene will necessarily be a game level.
 
Scenes
每個專案包含一個或多個文件稱為場景。
一個場景將包含一個單一的遊戲關卡,但主要的用戶界面元素,如遊戲菜單,遊戲主要在序列或停產的場景可能還生活在自己的場景文件。
複雜的遊戲,甚至整個場景只使用初始化的目的。
因此,所有的關卡在遊戲中一個最可能的場景,但不是每個場景必然是一個遊戲的關卡。
 
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
GameObjects, Components, Assets & Prefabs
Key to understanding Unity is the relationship between a GameObject and a Component.
 
GameObjects
A GameObject is the fundamental building block in Unity.
A GameObject is a container for different pieces of functionality called Components.
A GameObject almost always contains more than one Component.
All GameObjects contain a Transform Component, which defines its position and orientation.
 
GameObjects,Components,Assets 及Prefabs
關鍵是Unity認識一個遊戲對象之間的關係和組件。
 
GameObjects
A GameObject是在Unity 的基石。
A GameObject是一個容器在裡面的不同部分的功能稱為Components。
A GameObject幾乎總是包含多個Components。
所有GameObjects包含一個Transform Component,它定義了它的位置和方向。
 

GameObject Hierarchies
The real power of the GameObject is its ability to contain other GameObjects, acting much like a folder in OS X’s Finder.
This allows hierarchical organization of GameObjects, so a complex model or a complete lighting rig can be defined under a single parent GameObject. (In fact, most models will appear in Unity as a hierarchy of GameObjects because this reflects how they are defined in the modeling package.) A GameObject defined inside another GameObject is considered a child GameObject.
 
GameObject 的層次結構
GameObject真正的權力 是它能夠包含其他GameObjects,動作就像一個文件夾在OS X的Finder。
這使分層組織 GameObjects,所以一個複雜的模型或一個完整的照明設備可以被定義在一個單一父GameObject 。 (事實上,大部分模型將出現在一個層次結構的Unity ,因為這反映GameObjects如何被定義的建模套件。)一個GameObject 定義在另一個GameObject 被認為是子GameObject 。
 

Components
Components are the building blocks of GameObjects. Without them, the GameObject won’t do anything interesting.
A Component may represent visible entities, such as meshes, materials, terrain data or a particle system. Other Component types are more abstract, such as Cameras and Lights, which do not have a physical model representing them; instead, you will see an icon and some wire-­frame guidelines illustrating their key settings.
A Component is always attached to a GameObject; it cannot live alone. Multiple Components can be attached to the same GameObject.
GameObjects can support multiple Components of certain types—―a GameObject can contain any number of scripts, for example. But others, such as those used to define particle systems, are exclusive and can only appear once in any single GameObject. For example, if you want to define multiple particle systems, you would normally use a hierarchy of GameObjects, each containing its own set of particle system Components.
 
Components
Components是GameObjects的積木。如果沒有他們, GameObject會變得無趣。
一個組件可以代表有形實體,如網格,材質,地形數據或粒子系統。其他組件類型的比較抽象,如照相機和燈光,不具有物理模型代表他們,相反,你會看到一個圖標和一些電線架指引,說明他們的關鍵設置。
始終是一個Components連接到一個GameObjects,它不能獨自生存。個Components可以連接到同一個 GameObject。
GameObjects可以支持多種成分的Components - GameObject可以包含任意數量的腳本,例如。但其他人,例如那些用於定義粒子系統,是排他性的,只能出現一次,在任何一個 GameObject。例如,如果你想定義多個粒子系統,您通常會使用一個層次的GameObjects,每個都包含它自己的一套粒子系統組件。
 

Assets
All your imported Assets appear in the Project Pane and they can be almost anything:
a simple material or texture, audio files, or even a complete, prefabricated GameObject (known as a “Prefab”).
 
資源
所有導入的資源出現在Project Pane,他們幾乎可以是任何東西:
一個簡單的材料或質地,音頻文件,甚至是一個完整的,預設的GameObject(稱為“預設“)。
 
 
 
Custom Icons & Gizmos
You can tell Unity to display custom icons and other visual information for your Assets if you wish. We will see an example of this in the next chapter.
 
自定義圖標和小玩意兒
你可以告訴 Unity ,顯示自定義圖標和其他視覺信息只要你的想要的都成為您的資源。我們將看到一個例子,這在下一章。
 
Your project’s Assets are shown in the Project Pane.
When you drop one into your Scene, it appears in the Hierarchy Pane, which defines the content of the Scene. (A Scene is the equivalent of the stage in a theater. It can be a level, a menu, a multiplayer game lobby -­-­ whatever you wish.)
The Project Pane is retained across all Scenes in your Project.
您的專案的資產 在Project窗格中顯示。
當你把一到現場,它出現在層次結構窗格,它定義了內容的場景。 (相當於一個場景中的舞台戲劇。它可以是一個級別,一個菜單,多人遊戲大廳- 無論你的願望。)
Project窗格保留所有的場景在您的專案。
 
Prefabs
A Prefab is an Asset which has been defined as a template.
It is to Unity what a template document is to a word processing application.
When you place a Prefab into your Scene, Unity places a link to the Prefab into the Hierarchy Pane, not a complete copy. This is called instantiation.
Each link you make is referred to as an instance of the Prefab.
If you click on a Prefab in your Project Pane and tweak its settings, you will find that those changes are instantly reflected in all the instances in your Scene.
This makes Prefabs ideal for many re-­usable elements, such as bullets, enemies and so on.
If you find your enemy isn’t behaving correctly, you only need to adjust the script or settings in the original Prefab instead of editing each one in the Scene individually.
 
Prefabs
一個Prefabs是一種資產已被定義為一個模板。
它是一個Unity的模板文件什麼是文字處理應用程序。
當您將一個預製到現場,Unity放置一個鏈接到Prefab進入Hierarchy窗格中,不是一個完整的副本。這就是所謂的實例。
你做的每一個環節被稱為一個實例的Prefab。
如果你點擊了一個Prefab在Project窗格和調整其設置,你會發現,這些變化會立即反映在所有場景中的實例。
這使得許多Prefab ideal可重複使用的元素,如子彈,敵人等。
如果你發現你的敵人不是正確的行為,你只需要調整或設置的腳本在原來的Prefab而不是編輯在每一個單獨的場景。

However, if you need to adjust a couple of settings in a specific instance of a Prefab, you may do this too: these changes will only affect that particular instance.
 
但是,如果您需要調整的設置一對在一個特定的實例一Prefab,你可以做到這一點:這些變化只會影響該特定實例。
 
Prefabs are displayed in blue text in both the Project and Hierarchy Pane.
Prefab顯示在藍色文本中的項目和層次窗格。
 
NOTE
A Prefab instance cannot have additional Components added to it as doing so will break the link to the original Prefab.
Unity will warn you if you try and do this.
Unity will, however, allow you to update the original Prefab with such changes after the link is broken.
 
注意
一個Prefab實例不能額外添加組件進去,因為這樣做將打破原有的Prefab連結。
Unity會警告你,如果你嘗試這樣做。
Unity意志,但是,允許您更新原Prefab這種變化後,連結損毀。
 
Acknowledgments
This tutorial could not have been produced without the following people:
David Helgason, Joachim Ante, Tom Higgins, Sam Kalman, Keli Hlodversson, Nicholas Francis, Aras Pranckevičius, Forest Johnson and, of course, Ethan Vosburgh who produced the beautiful assets for this tutorial.
致謝
本教程已經不能生產,無需下列人員:
大衛黑爾加松,約阿希姆前廳,湯姆希金斯,山姆卡爾曼,科力Hlodversson,尼古拉弗朗西斯,阿拉斯Pranckevičius,森林約翰遜,當然,伊森沃斯堡誰製作美麗的資產本教程。
 
 
 
arrow
arrow
    全站熱搜

    createps 發表在 痞客邦 留言(0) 人氣()