取得原始碼¶
下載 Godot 原始碼¶
在 準備 SCons 建置系統 並編譯 Godot 前,必須要先下載 Godot 原始碼。
原始碼可以從 GitHub 上取得。雖然可以直接從這個網站上下載原始碼,但通常,我們會用 git
版本控制系統來下載。
若你是想參與貢獻或做 Pull Request 而需要編譯的話,請改參考 Pull Request 工作流程 中的說明。
若你還不熟悉 git
,在各種網站上都可以找到大量的 教學 。
一般來說,需要安裝 git
以及/或是其中一種 GUI 用戶端。
之後,要取得最新的開發版 Godot 原始碼 (也就是不穩定的 master
分支),可以使用 git clone
。
如果是使用 git
命令行指令,可以通過在終端機內輸入下列指令來完成:
git clone https://github.com/godotengine/godot.git
# You can add the --depth 1 argument to omit the commit history.
# Faster, but not all Git operations (like blame) will work.
要取得穩定版的原始碼,請前往 Release 頁面 並點擊所需的釋出版本連結。可以通過該頁面來下載並解壓縮原始碼。
With git
, you can also clone a stable release by specifying its branch or tag
after the --branch
(or just -b
) argument:
# Clone the continuously maintained stable branch (`3.x` as of writing).
git clone https://github.com/godotengine/godot.git -b 3.x
# Clone the `3.2.3-stable` tag. This is a fixed revision that will never change.
git clone https://github.com/godotengine/godot.git -b 3.2.3-stable
除了 master
之外,通常各個主要版本也都有各自的分支。
下載好 Godot 原始碼後,就可以 繼續編譯 Godot 了。