Resource part of a component. This represents the the static data that is deserialized from json. A run time counterpart is created after deserialization. Derived classes need to implement the DECLARE_COMPONENT macro, This macro tells the system what the run time counterpart of the resource is.
virtual void getDependentComponents |
( |
std::vector< rtti::TypeInfo > & |
components | ) |
const |
|
virtual |
Populates a list of components this component depends on. Every component dependency, when found, is initialized before this component. A dependency is NOT a hard requirement. Serialization will not fail if the dependent component isn't declared in JSON. It only means that when a component is declared under the same entity, and that component is tagged as a dependency of this component, it is initialized before this component. It is your responsibility to return false on initialization if the dependency is a hard requirement and can't be found. To ensure the right order of initialization based on a hard requirement it is advised to use a nap::ComponentPtr instead.
- Parameters
-
components | list of component types this resource depends on. |
Reimplemented in LightComponent, CameraController, PythonScriptComponent, RenderableMeshComponent, RotateComponent, Renderable3DTextComponent, RenderFrustumComponent, FirstPersonController, OrbitController, OrthoController, RenderGnomonComponent, RenderSkyBoxComponent, FluxMeasurementComponent, and CameraComponent.