Code Objects

User defined object component

This makes use of a custom class that can be attached to a object to add custom features to the Game.

We won't go into too much of an example here as the next page covers a use of this object to control the player. We will need to make use of the #include <Unified-Engine/Objects/scriptObject.h> header.

Here you can create a custom component that makes use of these functions.

class CustomAddon : UnifiedEngine::ScriptableObject{
    CustomAddon(ObjectComponent* Parent);
    int Render();
    int Update();
};

Then you can add it as a component to a GameObject using the ScripatbleObject initialiser which will request a parent object. The rest of the componenting will be handled backend and you shoudl be able to have your update functions run during the gameloop.

You can reference the parent object internally using this->Parent.

Last updated