![]() |
Rune Engine
Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
|
A component of a rune::GameObject, this class is used to add functionality to a object in the game world. More...
#include <component.h>


Public Member Functions | |
| Component ()=default | |
| Default constructor to set up. | |
| virtual void | awake () |
| A function that will be called before all other start functions but after the component has been assigned to a GameObject. | |
| virtual void | start () |
| A function for each component that is called once at the beginning of the components lifetime. | |
| virtual void | update () |
| A function for each component that is called every frame. | |
| virtual void | fixedUpdate () |
| A function for each component that is called once every physics update. | |
| void | setParent (GameObject *newParent) |
| A function to set the pointer to the parent rune::GameObject for each component. More... | |
| void | setEnable (bool newEnable) |
| Enable or disable the component. More... | |
| bool | isComponentEnabled (void) |
| Gets whether or not the current component is enabled. | |
| void | onNotify (Signal const &signal) override |
| A virtual method to be overridden by a concrete implementation of the observer class. | |
Protected Attributes | |
| GameObject * | parentObject = nullptr |
| The rune::GameObject that this component is attached to. If not attached to a rune::GameObject this will equal nullptr. | |
| bool | isEnabled = true |
| Whether or not the component is currently enabled. If not enabled, update function will not be called. | |
A component of a rune::GameObject, this class is used to add functionality to a object in the game world.
| void rune::Component::setEnable | ( | bool | newEnable | ) |
Enable or disable the component.
| newEnable | This value will replace the current value of the isEnable variable; |
| void rune::Component::setParent | ( | GameObject * | newParent | ) |
A function to set the pointer to the parent rune::GameObject for each component.
| newParent | A pointer to the rune::GameObject that this component belongs to. |