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.

提交到素材庫

前言

本教學將引導你如何將自己的素材提交到 Godot 素材庫,並與 Godot 社群分享。

如同 使用素材庫 文件中所述,若要提交素材至 AssetLib,你必須先註冊帳號並登入。

提交指引

在提交你的素材前,請確認已符合所有必要條件,也建議參考下方的推薦做法。

系統需求

一般來說,大多數提交到素材庫的資源都會被接受。但你的素材仍必須符合幾項審核條件,才有可能通過審查。

  • 素材必須**可以運作**。如果素材無法執行,或是在指定 Godot 版本下不能正常運作,將會被退件。

  • 素材必須包含正確的 .gitignore 檔案。保持倉庫乾淨、避免冗餘資料十分重要。這裡有一個範本

  • 不得包含**子模組**,或者任何子模組都必須是非必要的。GitHub 下載的 ZIP 檔不含子模組,因此若你的素材依賴子模組內容,將無法正常運作。

  • The license needs to be correct. The license listed on the asset library must match the license in the repository. The repository must have a license file, called either "LICENSE" or "LICENSE.md". This file must contain the license text itself and a copyright statement that includes the year(s) and copyright holder.

  • 素材名稱和描述請使用正確的**英文**。內容應有正確大小寫與完整句子。你亦可提供其他語言版本,但至少需有英文。

  • 圖示連結必須為**直接連結**。若圖示存放於 GitHub,連結須以「raw.githubusercontent.com」開頭,而非「github.com」。

建議

這些項目雖非必要條件,但若能遵循,將有助於素材庫生態更完善。

  • 建立非專案素材時,建議將檔案放在 addons/素材名稱/ 資料夾下,以避免與其他素材或使用者自身的檔案發生衝突。請注意,當使用者安裝你的素材時,這個資料夾**不會**自動建立。

  • 修正或隱藏所有腳本**警告**。警告機制是協助你檢查程式碼用的,但素材使用者不該看到這些警告。

  • Make your code conform to the official style guides. Having a consistent style helps other people read your code, and it also helps if other people wish to contribute to your asset. See the GDScript 風格指南 or the C# 風格指南.

  • If you have screenshots in your repository, place them in their own subfolder and add an empty .gdignore file in the same folder (note: gd, not git). This prevents Godot from importing your screenshots. On Windows, open a command prompt in the project folder and run type nul > .gdignore to create a file whose name starts with a period.

  • 若你的素材是用於處理其他檔案的函式庫,建議附上**範例檔案**。

  • Consider adding a .gitattributes file to your repository. This file allows giving extra instructions to Git, such as specifying line endings and listing files not required for your asset to function with the export-ignore directive. This directive removes such files from the resulting ZIP file, preventing them from being downloaded by the asset library users. These are common examples of .gitattributes:

    # Normalize line endings for all files that Git considers text files.
    * text=auto eol=lf
    
  • 若你提交的是外掛,請於外掛資料夾內附上一份授權和說明文件的**副本**。這樣可確保使用者日後保有這些檔案,並便於他們遵守你的授權規定。

  • 素材庫除了 GitHub 外也支援其他平台,但建議將原始碼託管在 GitHub。其他平台穩定性較差或不易被貢獻者使用。

提交

當你登入後,就可以前往 AssetLib 的「Submit Assets」(提交素材)頁面,如下圖所示:

image0

表單看似項目繁多(往下捲動會有更多欄位),但每個項目都有說明應填內容。以下我們也會逐項說明提交表單需填寫的資訊。

  • 素材名稱

    你的素材名稱。應為唯一且具描述性的標題。

  • 分類

    素材所屬分類,會顯示於搜尋結果。分類分為 Addons (外掛)和 Projects (專案)。專案類型(範本、展示、專案)僅在專案管理員中看到;外掛類型僅會在專案內部看見。

  • Godot 版本

    素材支援的引擎版本。目前無法在單一素材條目下提供多個版本下載,因此需針對每個Godot 版本分別提交。這在主要版本(如 Godot 2.x 與 3.x)間尤其重要。

  • 版本號

    素材的版本號。你可以用任何你喜歡的版本編號方式,但若想更清楚一致,建議參考 SemVer。此外,每次下載網址異動時,系統會自動增加一組內部版本號。

  • 倉庫平台

    提交到 AssetLib 的素材不會直接託管於平台上,而是指向第三方 Git 倉庫(如 GitHub、GitLab 或 Bitbucket)。此處需選擇你的素材所在的平台,以便系統產生正確的下載連結。

  • 倉庫網址

    The URL to your asset's files/webpage. This will vary based on your choice of provider, but it should look similar to https://github.com/<user>/<project>.

  • 問題追蹤網址

    The URL to your asset's issue tracker. Again, this will differ from repository host to repository host, but will likely look similar to https://github.com/<user>/<project>/issues. You may leave this field empty if you use your provider's issue tracker, and it's part of the same repository.

  • 下載 Commit

    The commit of the asset. For example, b1d3172f89b86e52465a74f63a74ac84c491d3e1. The site computes the actual download URL from this.

  • 圖示網址

    素材圖示的網址(將做為 AssetLib 搜尋結果與素材頁面的縮圖)。圖示需為 PNG 或 JPG 格式。

    圖示 必須為正方形(1:1 比例),最小解析度應為 128×128 像素。

備註

For icons hosted on GitHub, URLs must be provided in the form of https://raw.githubusercontent.com/<user>/<project>/<branch>/Icon.png.

  • 授權條款

    你的素材使用的授權條款。可選擇 GPL(v2 與 v3)、MIT、BSD、Boost 等多種自由/開源授權。詳細說明請參考 OpenSource.org

  • 描述

    最後,你可以在「描述」欄位中簡述素材特性、功能、行為與更新紀錄等。未來將支援 Markdown 格式,目前僅支援純文字。

你也可以上傳最多三個影片或圖片預覽,這些預覽將顯示在素材頁面底部。請勾選每個預覽項目的「啟用」方塊來開啟顯示。

  • 類型

    可為圖片或影片。

  • 圖片/YouTube 連結

    圖片連結,或託管於 YouTube 的影片連結。

  • 縮圖連結

    圖片連結,將用作預覽縮圖。此選項未來會移除,屆時縮圖將自動產生。

填寫完畢後,點擊「Submit」提交。你的素材將進入審核佇列。你可於 這裡 查看所有待審素材。審查為人工進行,可能需數天才會通過(或被退回),請耐心等候!

素材審查完畢後會通知你。若被退回,會告知原因,你可依建議修正後再次提交。