Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "SkyeCuillin/SkyeCuillin.h"
- class DemoController : public Engine::Component
- {
- public:
- float mValue;
- virtual bool Editor(std::string& prev, std::string& next)
- {
- SetupContext();
- return Engine::Component::DefaultEditor(this, &Reflection, prev, next);
- }
- virtual void Start()
- {
- mValue = 0.0f;
- }
- virtual void Update(float deltaTime)
- {
- mValue += 1.0f / 60.0f;
- if (mValue > 1.0f)
- {
- mValue -= 1.0f;
- }
- printf("%f %f %f\n",
- this->mGameObject->GetEntity()->Transformation().GetTranslation().x,
- this->mGameObject->GetEntity()->Transformation().GetTranslation().y,
- this->mGameObject->GetEntity()->Transformation().GetTranslation().z);
- }
- virtual std::string Serialize()
- {
- return Engine::Component::DefaultSerialize(this, &Reflection);
- }
- virtual void Deserialize(const std::string& data)
- {
- Engine::Component::DefaultDeserialize(this, &Reflection, data);
- }
- REFLECT()
- };
- REFLECT_STRUCT_BEGIN(DemoController)
- REFLECT_STRUCT_MEMBER(mValue)
- REFLECT_STRUCT_END()
- SKYE_CUILLIN_COMPONENT(DemoController)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement