Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

取得原始碼

下載 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 頁面 並點擊所需的釋出版本連結。可以通過該頁面來下載並解壓縮原始碼。

使用 git 時你還可以通過在 --branch (或者 -b )參數後指定分支或者標籤,來克隆穩定版本:

# 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 了。