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.

ResourceImporter

繼承: RefCounted < Object

被繼承: EditorImportPlugin, ResourceImporterBitMap, ResourceImporterBMFont, ResourceImporterCSVTranslation, ResourceImporterDynamicFont, ResourceImporterImage, ResourceImporterImageFont, ResourceImporterLayeredTexture, ResourceImporterMP3, ResourceImporterOBJ, ResourceImporterOggVorbis, ResourceImporterScene, ResourceImporterShaderFile, ResourceImporterSVG, ResourceImporterTexture, ResourceImporterTextureAtlas, ResourceImporterWAV

資源匯入器的基底類別。

說明

這是 Godot 資源匯入器的基底類別。要使用編輯器外掛程式實作你自己的資源匯入器,請參考 EditorImportPlugin

教學

方法

PackedStringArray

_get_build_dependencies(path: String) virtual const


列舉

enum ImportOrder: 🔗

ImportOrder IMPORT_ORDER_DEFAULT = 0

預設匯入順序。

ImportOrder IMPORT_ORDER_SCENE = 100

場景的匯入順序,確保場景被匯入在所有其他核心資源(如紋理)之後。自訂匯入器的匯入順序一般應低於100,以避免匯入依賴自訂資源的場景時出現問題。


方法說明

PackedStringArray _get_build_dependencies(path: String) virtual const 🔗

Called when the engine compilation profile editor wants to check what build options an imported resource needs. For example, ResourceImporterDynamicFont has a property called ResourceImporterDynamicFont.multichannel_signed_distance_field, that depends on the engine to be build with the "msdfgen" module. If that resource happened to be a custom one, it would be handled like this:

func _get_build_dependencies(path):
    var resource = load(path)
    var dependencies = PackedStringArray()

    if resource.multichannel_signed_distance_field:
        dependencies.push_back("module_msdfgen_enabled")

    return dependencies