mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
108 lines
6.9 KiB
ReStructuredText
108 lines
6.9 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. _class_ResourceImporter:
|
||
|
||
ResourceImporter
|
||
================
|
||
|
||
**Наследует:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
||
|
||
**Наследуется от:** :ref:`EditorImportPlugin<class_EditorImportPlugin>`, :ref:`ResourceImporterBitMap<class_ResourceImporterBitMap>`, :ref:`ResourceImporterBMFont<class_ResourceImporterBMFont>`, :ref:`ResourceImporterCSVTranslation<class_ResourceImporterCSVTranslation>`, :ref:`ResourceImporterDynamicFont<class_ResourceImporterDynamicFont>`, :ref:`ResourceImporterImage<class_ResourceImporterImage>`, :ref:`ResourceImporterImageFont<class_ResourceImporterImageFont>`, :ref:`ResourceImporterLayeredTexture<class_ResourceImporterLayeredTexture>`, :ref:`ResourceImporterMP3<class_ResourceImporterMP3>`, :ref:`ResourceImporterOBJ<class_ResourceImporterOBJ>`, :ref:`ResourceImporterOggVorbis<class_ResourceImporterOggVorbis>`, :ref:`ResourceImporterScene<class_ResourceImporterScene>`, :ref:`ResourceImporterShaderFile<class_ResourceImporterShaderFile>`, :ref:`ResourceImporterSVG<class_ResourceImporterSVG>`, :ref:`ResourceImporterTexture<class_ResourceImporterTexture>`, :ref:`ResourceImporterTextureAtlas<class_ResourceImporterTextureAtlas>`, :ref:`ResourceImporterWAV<class_ResourceImporterWAV>`
|
||
|
||
Базовый класс для импортеров ресурсов.
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
Описание
|
||
----------------
|
||
|
||
Это базовый класс для импортеров ресурсов Godot. Чтобы реализовать собственные импортеры ресурсов с помощью плагинов редактора, см. :ref:`EditorImportPlugin<class_EditorImportPlugin>`.
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
Обучающие материалы
|
||
--------------------------------------
|
||
|
||
- :doc:`Импорт плагинов <../tutorials/plugins/editor/import_plugins>`
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
Методы
|
||
------------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`_get_build_dependencies<class_ResourceImporter_private_method__get_build_dependencies>`\ (\ path\: :ref:`String<class_String>`\ ) |virtual| |const| |
|
||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Перечисления
|
||
------------------------
|
||
|
||
.. _enum_ResourceImporter_ImportOrder:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **ImportOrder**: :ref:`🔗<enum_ResourceImporter_ImportOrder>`
|
||
|
||
.. _class_ResourceImporter_constant_IMPORT_ORDER_DEFAULT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ImportOrder<enum_ResourceImporter_ImportOrder>` **IMPORT_ORDER_DEFAULT** = ``0``
|
||
|
||
Порядок импорта по умолчанию.
|
||
|
||
.. _class_ResourceImporter_constant_IMPORT_ORDER_SCENE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ImportOrder<enum_ResourceImporter_ImportOrder>` **IMPORT_ORDER_SCENE** = ``100``
|
||
|
||
Порядок импорта сцен, который гарантирует, что сцены импортируются *после* всех других основных ресурсов, таких как текстуры. Пользовательские импортеры обычно должны иметь порядок импорта ниже ``100``, чтобы избежать проблем при импорте сцен, которые полагаются на пользовательские ресурсы.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Описания метода
|
||
------------------------------
|
||
|
||
.. _class_ResourceImporter_private_method__get_build_dependencies:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **_get_build_dependencies**\ (\ path\: :ref:`String<class_String>`\ ) |virtual| |const| :ref:`🔗<class_ResourceImporter_private_method__get_build_dependencies>`
|
||
|
||
Вызывается, когда редактор профиля компиляции движка хочет проверить, какие параметры сборки нужны импортированному ресурсу. Например, :ref:`ResourceImporterDynamicFont<class_ResourceImporterDynamicFont>` имеет свойство с именем :ref:`ResourceImporterDynamicFont.multichannel_signed_distance_field<class_ResourceImporterDynamicFont_property_multichannel_signed_distance_field>`, которое зависит от движка, который будет собран с модулем "msdfgen". Если бы этот ресурс оказался пользовательским, он бы обрабатывался следующим образом:
|
||
|
||
::
|
||
|
||
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
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (Этот метод обычно должен быть переопределен пользователем, чтобы иметь какой-либо эффект.)`
|
||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||
.. |const| replace:: :abbr:`const (Этот метод не имеет побочных эффектов. Он не изменяет ни одну из переменных-членов экземпляра.)`
|
||
.. |vararg| replace:: :abbr:`vararg (Этот метод принимает любое количество аргументов после описанных здесь.)`
|
||
.. |constructor| replace:: :abbr:`constructor (Этот метод используется для создания типа.)`
|
||
.. |static| replace:: :abbr:`static (Этот метод не нуждается в вызове экземпляра, поэтому его можно вызвать напрямую, используя имя класса.)`
|
||
.. |operator| replace:: :abbr:`operator (Этот метод описывает допустимый оператор для использования с этим типом в качестве левого операнда.)`
|
||
.. |bitfield| replace:: :abbr:`BitField (Это значение является целым числом, составленным как битовая маска следующих флагов.)`
|
||
.. |void| replace:: :abbr:`void (Нет возвращаемого значения.)`
|