1. 程式人生 > >Unity學習筆記(一)——基本概念之場景(Scene)

Unity學習筆記(一)——基本概念之場景(Scene)

場景,顧名思義就是我們在遊戲中所看到的物品、建築、人物、背景、聲音、特效等,基本上和我們玩遊戲時所看到的遊戲“場景”是同一個概念。

Unity 3D中,“場景”是一個檢視,我們通過“場景”這個檢視,來編輯、佈置遊戲中玩家所能見到的影象和聲音。

安裝完並執行Unity 3D,會預設開啟一個AngryBots專案。我們在“Scene”檢視中,就可以直接看到一個場景:


這個場景中的物件,會在Hierachy檢視中通過層級關係列出來:


從上面這個層級關係我們看到,這個場景包括了:敵人、玩家、動態環境、靜態環境、主攝像機等等。

關於層級,在Unity的使用者手冊中有這麼一段話:

The Hierarchy

 contains every GameObject in the current Scene. Some of these are direct instances of asset files like 3D models, and others are instances of Prefabs, custom objects that will make up much of your game. You can select objects in the Hierarchy and drag one object onto another to make use of Parenting
 (see below). As objects are added and removed in the scene, they will appear and disappear from the Hierarchy as well.

有時候我們開啟專案之後看不到任何場景,就像這樣:


這是因為沒有選擇場景,只需要在Project->Assets下面選擇場景檔案即可,例如在AngryBots專案中,有一個名為AngryBots的場景(是一個Unity 3D的圖示):


雙擊開啟這個圖示,就可以開啟相應的場景:

場景檔案其實是在Assets資料夾內的一個.unity檔案:


參考資料:

  • 宣雨鬆《Unity 3D遊戲開發》第26頁
  • Walker Boys Studio的Unity 3D視訊教程:點選開啟連結