This page has been translated automatically.
Видеоуроки
Interface
Essentials
Advanced
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Настройки и предпочтения
Работа с проектами
Настройка параметров узла
Setting Up Materials
Настройка свойств
Освещение
Landscape Tool
Sandworm
Использование инструментов редактора для конкретных задач
Extending Editor Functionality
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World Objects
Звуковые объекты
Объекты поиска пути
Players
Программирование
Основы
Настройка среды разработки
Примеры использования
UnigineScript
C++
C#
Унифицированный язык шейдеров UUSL
File Formats
Rebuilding the Engine Tools
GUI
Двойная точность координат
API
Containers
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Art Samples
Tutorials
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

ComponentSystem Class

This class implements functionality of the C# Component System and is used to create, destroy, and manage components.

Notice
This class is a singleton.

See Also#

  • C# Sample: source/samples/Api/Logics/ComponentSystem

ComponentSystem Class

Members


public static void SetEnabled ( bool enable ) #

Enables or disables the C# Component System.

Arguments

  • bool enable - Use true to enable the C# Component System, false - to disable it.

public static int IsEnabled ( ) #

Returns a value indicating whether the C# Component System is enabled.

Return value

true if the C# Component System is enabled; otherwise false.

public static void SaveProperties ( ) #

Creates property files for all components. Parameters of each component are stored in a separate *.prop file. If these property files do not exist, they will be created in the data/.runtimes folder.

public static void SaveProperties ( out List <string> created_files, out List <string> modified_files, out List <string> broken_files ) #

Creates property files for all components and returns lists of created, modified, and broken files. Parameters of each component are stored in a separate *.prop file. If these property files do not exist, they will be created in the data/.runtimes folder.

Arguments

  • out List <string> created_files - Buffer list to which paths to all created *.prop files will be placed.
  • out List <string> modified_files - Buffer list to which paths to all modified *.prop files will be placed.
  • out List <string> broken_files - Buffer list to which paths to all broken *.prop files will be placed.

public static T AddComponent<T> ( Node node ) #
where T : Component

Adds the component to the specified node.

Arguments

  • Node node - Node, to which the component is to be added.

Return value

New added component instance, if it was successfully added to the specified node; otherwise null.

public static T GetComponent<T> ( Node node, bool enabled_only ) #
where T : Class

Returns the first component of the specified type associated with the specified node.

Arguments

  • Node node - Node, for which the component of this type is to be found.
  • bool enabled_only - Enabled flag: true to get enabled component only, false to get component in any case.

Return value

Component if it exists; otherwise, null.

public static T[] GetComponents<T> ( Node node, bool enabled_only ) #
where T : Class

Returns all components of this type assigned to the specified node.

Arguments

  • Node node - Node, whose components are to be retrieved.
  • bool enabled_only - Enabled flag: true to get only enabled components, false to get all components.

Return value

Array containing all found components of this type (if any); otherwise null.

public static T GetComponentInChildren<T> ( Node node, bool enabled_only ) #
where T : Class

Returns the first component of this type found among all the children of the specified node (including the node itself). This method searches for the component in the following order:
  • node itself
  • node reference
  • node's children
  • children of node's children

Arguments

  • Node node - Node, whose hierarchy is to be checked for the components of this type.
  • bool enabled_only - Enabled flag: true to get enabled component only, false to get component in any case.

Return value

Component if it exists; otherwise, null.

public static T[] GetComponentsInChildren<T> ( Node node, bool enabled_only ) #
where T : Class

Searches for all components of this type down the hierarchy of the specified node.

Arguments

  • Node node - Node, whose hierarchy is to be checked for the components of this type.
  • bool enabled_only - Enabled flag: true to get only enabled components, false to get all components.

Return value

Array containing all found components of this type (if any); otherwise null.

public static T GetComponentInParent<T> ( Node node, bool enabled_only ) #
where T : Class

Returns the first component of this type found among all predecessors and posessors of the specified node.

Arguments

  • Node node - Node, whose hierarchy is to be checked for the components of this type.
  • bool enabled_only - Enabled flag: true to get enabled component only, false to get component in any case.

Return value

Component if it exists; otherwise, null.

public static T[] GetComponentsInParent<T> ( Node node, bool enabled_only ) #
where T : Class

Searches for all components of this type up the hierarchy of the specified node.

Arguments

  • Node node - Node, whose hierarchy is to be checked for the components of this type.
  • bool enabled_only - Enabled flag: true to get only enabled components, false to get all components.

Return value

Array containing all found components of this type (if any); otherwise null.

protected T FindComponentInWorld<T> ( bool enabled_only ) #
where T : Class

Returns the first component of this type found in the current world.

Arguments

  • bool enabled_only - Enabled flag: true to get enabled component only, false to get component in any case.

Return value

Component if it exists; otherwise, null.

protected T[] FindComponentsInWorld<T> ( bool enabled_only ) #
where T : Class

Returns the list of all components of this type found in the current world.

Arguments

  • bool enabled_only - Enabled flag: true to get only enabled components, false to get all components.

Return value

Array containing all found components of this type (if any); otherwise null.

public static int RemoveComponent<T> ( Node node ) #
where T : Class

Removes the component from the specified node.

Arguments

  • Node node - Node, from which the component is to be removed.

Return value

1 if the component was successfully removed from the specified node; otherwise 0.

public static int RemoveComponent ( Component component ) #

Removes the specified component.

Arguments

  • Component component - Component to be removed.

Return value

1 if the specified component was successfully removed; otherwise 0.

void GetStatistics ( out int nodes, out int components, out int methods ) #

Returns the current state of the Component System (total number of components, nodes having components assigned, as well as methods for components) putting the values to corresponding variables.

Arguments

  • out int nodes - Total number of nodes with components.
  • out int components - Total number of components.
  • out int methods - Total number of methods in the Component System.
Last update: 26.05.2021
Build: ()