Skip to main content

Component

class Component

To give functionality to a certain object you attach different components to it, for example your own scripts are components, all components inherit from this class.


public class Component extends InspectorMemory

— Constructors (1) —

ConstructorDescription
Component()Creates a new Component.

— Methods (23) —

NameDescription
void start()Runs once(runs on engine thread) when the script is called.
void preRepeat()Runs at every frame after the "start" function and before the "parallel" functions if the object and component are active in the hierarchy (runs on engine thread), that is, if the game is running at "60 fps", it will run 60 times per second.
void parallelRepeat()Runs at every frame if the object and component are active in the hierarchy(runs in a separate thread), that is, if the game is running at "60 fps", it will run 60 times per second.
void disabledParallelRepeat()Runs at every frame if object and component are disabled in the hierarchy(runs in a separate thread), that is, if the game is running at "60 fps", it will run 60 times per second.
void repeat()Runs at every frame if the object and component are active in the hierarchy(runs on engine thread), that is, if the game is running at "60 fps", it will run 60 times per second.
void posRepeat()Runs at every frame after functions that contain "repeat" if the object and component are active in the hierarchy (runs on engine thread), that is, if the game is running at "60 fps", it will run 60 times per second.
void disabledRepeat()Runs at every frame if object and component are disabled in the hierarchy(runs on engine thread), that is, if the game is running at "60 fps", it will run 60 times per second.
void stoppedRepeat()Runs at every frame if the game is stopped(editor only, runs on engine thread), that is, if the game is running at "60 fps", it will run 60 times per second.
void pausedRepeat()Runs at every frame if the game is paused (editor only,runs on engine thread), that is, if the game is running at "60 fps", it will run 60 times per second.
boolean isEnabled()Returns true if the Component is enabled, false if not.
void setEnabled(boolean enabled)Define if the Component is enabled or disabled to be "enabled" argument.
void invoke(float delaySeconds, [InvokeListener] invokeListener)Invokes a method call after the time determined to be "delaySeconds" argument.
void cancelAllInvokes()Cancels method call invocations.
void print(String message)Shows in the console the text passed to be "message" argument.
void print(int number)Shows in the console the "int" type number passed to be "number" argument.
void print(float number)Shows in the console the "float" type number passed to be "number" argument.
SpatialObject getObject()Returns the object to which the component is attached.
String getComponentMenu()Defines the menu that the component appears in the popup menu that adds components to objects.
Color getComponentColor()Defines the color of the Component in the object's component list.
String getComponentTittle()Sets the component's title in the object's component list.
void destroy()Delete the Component.
boolean isHierarchyActive()Returns true when both the object and the Component are active in the hierarchy.
GUID getGUID()Returns the guid of the Object to which the Component is attached.