This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
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
CIGI Client Plugin
Rendering-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.
No UnigineScript code for this page,
shown in C# instead.

Component Class

Read More

Component Class

Members


public void SetEnabled ( bool enable ) #

Enables or disables the component.

Arguments

  • bool enable - Use true to enable the component, false — to disable it.

public int IsEnabled ( ) #

Returns a value indicating whether the component is enabled.

Return value

true if the component is enabled; otherwise false.

protected void OnReady ( ) #

This method is called by the Engine, when the component is ready for initialization. You can override this method and use it instead of the constructor for initialization, as the component is in an "undefined" state at construction time.

protected void OnEnable ( ) #

This method is called by the Engine, when the component and node become enabled and active. You can override this method to implement some specific actions to be performed each time, when the component becomes enabled.

protected void OnDisable ( ) #

This method is called by the Engine, when the component and node become disabled. You can override this method to implement some specific actions to be performed each time, when the component becomes disabled.

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

Adds the component to the specified node. This method is equivalent to ComponentSystem.AddComponent() method.

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.

protected T GetComponent<T> ( Node node, bool enabled_only ) #
where T : Component

Returns the first component of the specified type associated with the specified node. This method is equivalent to ComponentSystem.GetComponent() method.

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.

protected T[] GetComponents<T> ( Node node, bool enabled_only ) #
where T : Component

Returns all components of this type assigned to the specified node. This method is equivalent to ComponentSystem.GetComponents() method.

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.

protected T GetComponentInChildren<T> ( Node node, bool enabled_only ) #
where T : Component

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
This method is equivalent to ComponentSystem.GetComponentInChildren() method.

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.

protected T[] GetComponentsInChildren<T> ( Node node, bool enabled_only ) #
where T : Component

Searches for all components of this type down the hierarchy of the specified node. This method is equivalent to ComponentSystem.GetComponentsInChildren() method.

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 GetComponentInParent<T> ( Node node, bool enabled_only ) #
where T : Component

Returns the first component of this type found among all predecessors and posessors of the specified node. This method is equivalent to ComponentSystem.GetComponentInParent() method.

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.

protected T[] GetComponentsInParent<T> ( Node node, bool enabled_only ) #
where T : Component

Searches for all components of this type up the hierarchy of the specified node. This method is equivalent to ComponentSystem.GetComponentsInParent() method.

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 : Component

Returns the first component of this type found in the current world. This method is equivalent to ComponentSystem.FindComponentInWorld() method.

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 : Component

Returns the list of all components of this type found in the current world. This method is equivalent to ComponentSystem.FindComponentsInWorld() method.

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.

protected int RemoveComponent<T> ( Node component ) #
where T : Component

Removes the component from the specified node. This method is equivalent to ComponentSystem.RemoveComponent() method.

Arguments

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

Return value

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

protected int RemoveComponent ( Component node ) #

Removes the specified component. This method is equivalent to ComponentSystem.RemoveComponent() method.

Arguments

  • Component node - Component to be removed.

Return value

1 if the specified component was successfully removed; otherwise 0.
Last update: 2019-08-16
Build: ()