Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Game/Entity/Component.h"
- #include "Core/Plugin/Reflection.h"
- char mName[] = "DemoController";
- class DemoController : public Engine::Component
- {
- public:
- float mValue;
- virtual bool Editor(std::string& prev, std::string& next)
- {
- return false;
- }
- virtual void Start()
- {
- mValue = 0.0f;
- }
- virtual void Update(float deltaTime)
- {
- mValue += 1.0f / 60.0f;
- if (mValue > 1.0f)
- {
- mValue -= 1.0f;
- }
- }
- virtual std::string Serialize()
- {
- return "";
- }
- virtual void Deserialize(const std::string& data)
- {
- }
- REFLECT()
- };
- REFLECT_STRUCT_BEGIN(DemoController)
- REFLECT_STRUCT_MEMBER(mValue)
- REFLECT_STRUCT_END()
- extern "C" __declspec(dllexport) Engine::Component* CreateBehavior()
- {
- Engine::Component* component = new DemoController();
- return component;
- }
- extern "C" __declspec(dllexport) const char* GetName()
- {
- return mName;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement