Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include "SkyeCuillin.h" class DemoController : public Engine::Component { public: static std::string mComponentName; Engine::float4 mFloat4Value; Engine::mat4 mMatrixValue; float mValue; int mIntValue; std::string mStringValue; virtual std::string& GetName() override { return mComponentName; } virtual bool Editor(std::string& prev, std::string& next) { SetupContext(); return Engine::Component::DefaultEditor(this, &Reflection, prev, next); } virtual void Init() { 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_MEMBER(mIntValue) REFLECT_STRUCT_MEMBER(mFloat4Value) REFLECT_STRUCT_MEMBER(mMatrixValue) REFLECT_STRUCT_MEMBER(mStringValue) REFLECT_STRUCT_END() SKYE_CUILLIN_COMPONENT(DemoController)
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)