| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #pragma once
- #include "../Scene/Component.h"
- namespace Atomic
- {
- class ATOMIC_API PrefabComponent : public Component
- {
- ATOMIC_OBJECT(PrefabComponent, Component);
- public:
- /// Construct.
- PrefabComponent(Context* context);
- /// Destruct.
- virtual ~PrefabComponent();
- /// Register object factory.
- static void RegisterObject(Context* context);
- void SetPrefabGUID(const String& guid);
- const String& GetPrefabGUID() const { return prefabGUID_; }
- bool SavePrefab();
- void UndoPrefab();
- void BreakPrefab();
- protected:
- /// Handle scene node being assigned at creation.
- virtual void OnNodeSet(Node* node);
- private:
- void HandlePrefabChanged(StringHash eventType, VariantMap& eventData);
- void LoadPrefabNode();
- String prefabGUID_;
- };
- }
|