Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
取得原始碼
下載 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 (shallow clone).
# A shallow clone is faster, but not all Git operations (like blame) will work.
要取得穩定版的原始碼,請前往 Release 頁面 並點擊所需的釋出版本連結。可以通過該頁面來下載並解壓縮原始碼。
使用 git
時你還可以通過在 --branch
(或者 -b
)參數後指定分支或者標籤,來克隆穩定版本:
# Clone the continuously maintained stable branch (`4.3` as of writing).
git clone https://github.com/godotengine/godot.git -b 4.3
# Clone the `4.3-stable` tag. This is a fixed revision that will never change.
git clone https://github.com/godotengine/godot.git -b 4.3-stable
# After cloning, optionally go to a specific commit.
# This can be used to access the source code at a specific point in time,
# e.g. for development snapshots, betas and release candidates.
cd godot
git checkout f4af8201bac157b9d47e336203d3e8a8ef729de2
The maintenance branches are used to release further patches on each minor version.
You can get the source code for each release and pre-release in .tar.xz
format from
godotengine/godot-builds on GitHub.
This lacks version control information but has a slightly smaller download size.
下載好 Godot 原始碼後,就可以 繼續編譯 Godot 了。