44 behavior_->on_serialize(out);
48 behavior_->on_deserialize(data, offset);
53 std::unique_ptr<Behavior> behavior_;
Base class for defining logic that can be attached to Components, similar to Unity's MonoBehaviour.
Definition behavior.h:34
Component that hosts a Behavior.
Definition behaviorscript.h:27
virtual void on_deserialize(const std::vector< uint8_t > &data, size_t &offset)
Deserializes the component's state from a byte array.
Definition behaviorscript.h:46
std::string type_name() const override
Provides a consistent type name for the component.
void on_detach() override
Called when the component is detached from a GameObject.
virtual void on_serialize(std::vector< uint8_t > &out) const
Serializes the component's state into a byte array.
Definition behaviorscript.h:43
BehaviorScript & disable()
BehaviorScript(std::unique_ptr< Behavior > behavior)
void on_attach() override
Called when the component is attached to a GameObject.
BehaviorScript & enable()
void update(float dt) override
Base class for all components that can be attached to GameObjects.
Definition component.h:24