Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Unity遊戲程式設計(01) Unity簡介
Search
Wu, ShyiShiou
November 11, 2016
Programming
0
500
Unity遊戲程式設計(01) Unity簡介
介紹Unity IDE基本操作
Wu, ShyiShiou
November 11, 2016
Tweet
Share
More Decks by Wu, ShyiShiou
See All by Wu, ShyiShiou
使用Evernote雲端筆記本
sswu
0
68
mBot教學(6)光感測器應用
sswu
0
630
Unity遊戲程式設計(04) 2D移動與碰撞處理I
sswu
0
1.2k
Unity遊戲程式設計(02) 應用2D圖片物件
sswu
0
1k
Unity遊戲程式設計(03) 製作及應用2D動畫
sswu
0
1.2k
Other Decks in Programming
See All in Programming
サイコロで理解する統計的仮説検定の考え方
tatamiya
4
950
ゆるい個人開発のススメ
kuroppe1819
10
990
冗長なエラーログを削減し、スタックトレースを手に入れる / Reducing Verbose Error Logs and Obtaining Stack Traces
upamune
0
790
SwiftUIで使いやすいToastの作り方 / How to build a Toast system which is easy to use in SwiftUI
lovee
3
150
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
210
エンターテイメント業界で利用されるAWS
demuyan
0
210
"config" ってなんだ? / What is "config"?
okashoi
0
240
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
230
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
270
MicrosoftのPlatform Engineeringガイドを読んで実際になにかやってみた
ymd65536
1
340
if constexpr文はテンプレート世界のラムダ式である
faithandbrave
3
650
PHPの次期バージョンはこの時期どうなっているのか - Internalsの開発体制について - PHPカンファレンス小田原
youkidearitai
PRO
1
190
Featured
See All Featured
Facilitating Awesome Meetings
lara
42
5.6k
The Cult of Friendly URLs
andyhume
74
5.7k
Fantastic passwords and where to find them - at NoRuKo
philnash
37
2.5k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
125
32k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
6
1.5k
Fashionably flexible responsive web design (full day workshop)
malarkey
398
65k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
116
18k
Why Our Code Smells
bkeepers
PRO
331
56k
How GitHub (no longer) Works
holman
304
140k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
9
8.3k
Raft: Consensus for Rubyists
vanstee
132
6.3k
Typedesign – Prime Four
hannesfritz
36
2.1k
Transcript
電子工程系應 用 電 子 組 電 腦 遊 戲 設
計 組 Unity遊戲程式設計(01) Unity簡介 吳錫修 Oct 12, 2016
shape the future Unity Technologies公司於2005年推出的⼀款功能強⼤的遊戲開發 工具 4.2版以前專為3D遊戲開發而設計,稱為Unity 3D
4.3版本起增加⼀套2D遊戲開發工具包,加入2D物理引擎,重新正 名為Unity;開發遊戲專案時可選擇2D或3D遊戲專案 關於Unity 1/2 Wu, ShyiShiou Dept. of E.E., NKUT 2
shape the future 2015年3月推出Unity 5版本 個人版 (personal):營收在10萬美元以下的用戶可免費使用
專業板 (professional):每月75美元起 關於Unity 2/2 Wu, ShyiShiou Dept. of E.E., NKUT 3
shape the future https://unity3d.com/cn/get-unity/download/archive 下載unity軟體 4 Wu, ShyiShiou Dept.
of E.E., NKUT
shape the future 範例專案 Wu, ShyiShiou Dept. of E.E., NKUT
5
shape the future Unity編輯環境 階層面板 專案面板 場景面板 屬性面板 工具列 Wu,
ShyiShiou Dept. of E.E., NKUT 6
shape the future 顯示目前場景中的所有物件,並依照物件間的階層關係排列 例如最上層物件有攝影機 (Cameras)、車子 (Car)、燈光 (Lighta)…
車子物件包括碰撞機 (Colliders)、輪轂 (WheelsHubs)… 階層面板 (Hierarchy) 1/2 Wu, ShyiShiou Dept. of E.E., NKUT 7
shape the future 將物件拖曳到另⼀物件下,物件就被群組在⼀起,最上層物件稱為 父物件,其它物件則為其子物件 ⼀個不屬於任何群組的物件,是以世界座標原點為參考點;而子物 件則是以其以父物件為座標原點
子物件會隨著父物件旋轉、移動、縮放 階層面板 (Hierarchy) 2/2 Wu, ShyiShiou Dept. of E.E., NKUT 8
shape the future 變形工具:對物件進行移動、旋轉、縮放、平面編輯 (2D物件) 旋轉軸心切換:中心點 (Center) 或支點
(Pivot) 座標切換:自身座標 (Local) 或世界座標 (Global) 撥放控制器:測試遊戲、暫停、或單步執行 工具列 1/2 變形工具 座標切換 撥放控制器 Wu, ShyiShiou Dept. of E.E., NKUT 9 旋轉軸心切換
shape the future 工具列 2/2 10 Wu, ShyiShiou Dept. of
E.E., NKUT 平移場景(Q) 旋轉物體(E) (T)針對一個平面進行移動、 旋轉及縮放,在編輯2D物 件時較常使用 移動物體(W) 縮放物體(R)
shape the future 管理專案所有資源,所有專案都會有Assets根目錄,最好建立子資 料夾分門別類管理不同資源類型,常用資源包括: 場景 (Scene)、預製物件 (Prefab)、程式腳本
(Script)、3D模型 (Model)、 圖片 (Sptite)、音效 (Audio)、動畫 (Animation)… 專案面板 (Project) Wu, ShyiShiou Dept. of E.E., NKUT 11
shape the future 場景指的就是遊戲畫面,可以在這個場景視窗中擺設遊戲物件 場景面板 (Scene) 1/2 Wu, ShyiShiou
Dept. of E.E., NKUT 12 圖示選單 2D/3D切換 場景燈光開關 天空背景關闗 音效預覽
shape the future 旋轉場景:Alt+滑鼠左鍵 拉近/拉遠場景:滑鼠滾輪或Alt+滑鼠右鍵 將物件顯示於視窗中央: A.
在Hierarchy面板,雙擊物件 B. 在場景中點選物件後,按F鍵 第⼀人稱瀏覽(旋轉)場景:滑鼠右鍵 場景面板 (Scene) 2/2 Wu, ShyiShiou Dept. of E.E., NKUT 13
shape the future 模擬遊戲進行時的畫面 (可以全畫面執行),也可以顯示遊戲的執行 效能數據 遊戲面板 (Game) Wu,
ShyiShiou Dept. of E.E., NKUT 14
shape the future 顯示目前選取物件之所有可設定的屬 性,例如物件名稱、座標、物件種 類…等 若物件已附加燈光、攝影機、碰撞器、 程式腳本等元件,也可直接從屬性視
窗中設定各項參數 屬性面板 (Inspector) Wu, ShyiShiou Dept. of E.E., NKUT 15
shape the future Unity提供多種預設的版面配置讓使用者自由選擇,也可以儲存當前 自訂義的版面配置方式 自訂版面配置 Wu, ShyiShiou Dept.
of E.E., NKUT 16
shape the future File選單New Project…命令 建立新專案 1/2 17 Wu,
ShyiShiou Dept. of E.E., NKUT
shape the future 指定專案名稱、儲存位置,以及遊戲類型 (2D或3D) Asset packages…:設定要附加到專案的套件。可以在專案開發過 程中,需要時再匯入
建立新專案 2/2 18 Wu, ShyiShiou Dept. of E.E., NKUT
shape the future File選單New Scene命令 場景就是遊戲畫面 編輯過程中記得透過快捷鍵Ctrl-S儲存場景,副檔名.unity
新增場景 19 Wu, ShyiShiou Dept. of E.E., NKUT
shape the future 點選Main Camera,Inspector面版Camera>Projection Orthographic 正交投影,物體沒有前後距離分別
Perspective 透視投影,物體有前後距離之分別 攝影機投影模式 20 Wu, ShyiShiou Dept. of E.E., NKUT Perspective Orthographic
shape the future Edit選單Preferences…命令 建議使用內建的MonoDevelop編輯器 腳本編輯器 21 Wu,
ShyiShiou Dept. of E.E., NKUT
shape the future 電子工程系應 用 電 子 組 電 腦
遊 戲 設 計 組 Unity Asset Store有非常豐富的套件,其中不乏免費資源。由Asset Store面板搜尋想要的Unity範例,例如Survival Shooter 下載官方資源 1/5 22
shape the future 電子工程系應 用 電 子 組 電 腦
遊 戲 設 計 組 點擊Download 下載官方資源 2/5 23
shape the future 電子工程系應 用 電 子 組 電 腦
遊 戲 設 計 組 登錄Unity帳號 下載官方資源 3/5 24
shape the future 電子工程系應 用 電 子 組 電 腦
遊 戲 設 計 組 等待下載並解密 已下載過的套件會儲存在c:\Users\用戶名稱\AppData\Roaming\ Unity\Asset Store-5.x目錄下 下載官方資源 4/5 25
shape the future 電子工程系應 用 電 子 組 電 腦
遊 戲 設 計 組 選取要滙入要專案的資源,再點擊Import按鈕 下載官方資源 5/5 26
shape the future 了解遊戲引擎事件程序的執行流程,才能正確安排程式腳本,調校 遊戲效能 https://docs.unity3d.com/Manual/ExecutionOrder.html 事件函式執行流程 1/3
27 Wu, ShyiShiou Dept. of E.E., NKUT
shape the future 事件函式執行流程 2/3 28 Wu, ShyiShiou Dept. of
E.E., NKUT
shape the future 事件函式執行流程 3/3 29 Wu, ShyiShiou Dept. of
E.E., NKUT
shape the future 專案內容可以封裝成Unitypackage檔,來備份專案的進度或移植到 其它電腦上使用 Assets選單Export Package…命令 匯出package
30 Wu, ShyiShiou Dept. of E.E., NKUT