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 4.3 升級到 Godot 4.4
對於大多數以 4.3 製作的遊戲與應用程式,遷移到 4.4 應該相對安全。此頁面旨在涵蓋專案遷移時需要留意的所有事項。
做出更改
如果你要從 4.3 遷移到 4.4,這裡列出的不相容變更可能會影響到你。變更依領域/系統分類整理。
這篇文章指出了每項破壞性改動是否會影響 GDScript,以及 C# 的破壞性改動是 二進位相容 還是 原始程式碼相容:
二進位相容 - 現有二進位檔可在無需重新編譯的情況下成功載入與執行,且執行時行為不會改變。
** 原始程式碼相容** —— 在升級 Godot 時,原始程式碼可成功編譯,無需更改。
核心
改動 |
GDScript 格式化字串 |
C# 二進位相容 |
C# 原始程式碼相容 |
簡介 |
|---|---|---|---|---|
FileAccess |
||||
方法 |
✔️ |
✔️ |
✔️ |
|
方法 |
✔️ |
❌ |
✔️ |
|
方法 |
✔️ |
❌ |
✔️ |
|
方法 |
✔️ |
❌ |
✔️ |
|
方法 |
✔️ |
❌ |
✔️ |
|
方法 |
✔️ |
❌ |
✔️ |
|
方法 |
✔️ |
❌ |
✔️ |
|
方法 |
✔️ |
❌ |
✔️ |
|
方法 |
✔️ |
❌ |
✔️ |
|
方法 |
✔️ |
❌ |
✔️ |
|
方法 |
✔️ |
❌ |
✔️ |
|
方法 |
✔️ |
❌ |
✔️ |
|
方法 |
✔️ |
❌ |
✔️ |
|
方法 |
✔️ |
❌ |
✔️ |
|
方法 |
✔️ |
❌ |
✔️ |
|
OS |
||||
方法 |
✔️ |
✔️ |
✔️ |
|
方法 |
❌ |
✔️ |
✔️ |
|
RegEx |
||||
方法 |
✔️ |
✔️ |
✔️ |
|
方法 |
✔️ |
✔️ |
✔️ |
|
Semaphore |
||||
方法 |
✔️ |
✔️ |
✔️ |
|
TranslationServer |
||||
方法 |
✔️ |
✔️ |
✔️ |
匯出註解
警告
The behavior of @export_file changed in Godot 4.4. When assigning a new value
from the Inspector, the path is now stored and returned as a uid:// reference
instead of the traditional res:// path (GH-97912). This is a breaking change and may
cause issues if you're expecting res://-based paths in scripts or serialized
files.
例如,匯出的檔案陣列現在可能同時包含 uid:// 與 res:// 路徑,特別是在它們曾部分於屬性面板中編輯過的情況下。
In 4.4, the only way to retain the res:// format is to manually edit the
.tscn or .tres files in a text editor. Starting in Godot 4.5, a new annotation
@export_file_path can be used to explicitly retain the old behavior and export
raw res:// paths.
建立節點
改動 |
GDScript 格式化字串 |
C# 二進位相容 |
C# 原始程式碼相容 |
簡介 |
|---|---|---|---|---|
RichTextLabel |
||||
方法 |
✔️ |
✔️ |
✔️ |
|
方法 |
✔️ |
✔️ |
✔️ |
|
圖形編輯器(GraphEdit) |
||||
方法 |
✔️ |
✔️ |
✔️ |
|
訊號 |
❌ |
❌ |
❌ |
物理
改動 |
GDScript 格式化字串 |
C# 二進位相容 |
C# 原始程式碼相容 |
簡介 |
|---|---|---|---|---|
SoftBody3D |
||||
方法 |
✔️ |
✔️ |
✔️ |
算繪
改動 |
GDScript 格式化字串 |
C# 二進位相容 |
C# 原始程式碼相容 |
簡介 |
|---|---|---|---|---|
CPUParticles2D |
||||
方法 |
✔️ |
✔️ |
✔️ |
|
CPUParticles3D |
||||
方法 |
✔️ |
✔️ |
✔️ |
|
GPUParticles2D |
||||
方法 |
✔️ |
✔️ |
✔️ |
|
GPUParticles3D |
||||
方法 |
✔️ |
✔️ |
✔️ |
|
算繪 |
||||
方法 |
✔️ |
✔️ |
✔️ |
|
方法 |
❌ |
✔️ |
✔️ |
|
方法 |
✔️ |
✔️ |
✔️ |
|
方法 |
✔️ |
✔️ |
✔️ |
|
方法 |
✔️ |
✔️ |
✔️ |
|
RenderingServer |
||||
方法 |
✔️ |
✔️ |
✔️ |
|
Shader |
||||
方法 |
✔️ |
❌ |
❌ |
|
方法 |
✔️ |
❌ |
✔️ |
|
VisualShaderNodeCubemap |
||||
屬性 |
✔️ |
❌ |
❌ |
|
VisualShaderNodeTexture2DArray |
||||
屬性 |
✔️ |
❌ |
❌ |
備註
在 C# 中,列舉 RenderingDevice.StorageBufferUsage 因綁定產生器判定列舉前綴的方式而出現相容性破壞。GH-100062 新增了成員,導致列舉成員被重新命名。
編輯器外掛程式
改動 |
GDScript 格式化字串 |
C# 二進位相容 |
C# 原始程式碼相容 |
簡介 |
|---|---|---|---|---|
編輯器界面 (C++) |
||||
方法 |
✔️ |
✔️ |
✔️ |
|
方法 |
✔️ |
✔️ |
✔️ |
|
方法 |
✔️ |
✔️ |
✔️ |
|
EditorSceneFormatImporter |
||||
方法 |
❌ |
❌ |
❌ |
|
EditorTranslationParserPlugin |
||||
方法 |
❌ |
❌ |
❌ |
備註
方法 _get_import_flags 從未被引擎使用。雖然會造成相容性破壞,但因為使用者無法依賴此方法來影響引擎行為,因此予以移除。
做出更改
核心
備註
Curve 資源現在會強制套用其數值範圍,因此如果任何節點超出預設的 [0, 1] 範圍,就需要調整 min_value 與 max_value。
算繪
備註
VisualShaderNodeVec4Constant 著色器節點的輸入型別已改為 Vector4。使用者需要重新建立其常數中的數值。
CSG
Android
備註
Android 感測器事件不再預設啟用(GH-94799)。使用感測器事件的專案可於專案設定的 Input Devices > Sensors 依需求啟用。