PrefabImporter.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  3. // LICENSE: Atomic Game Engine Editor and Tools EULA
  4. // Please see LICENSE_ATOMIC_EDITOR_AND_TOOLS.md in repository root for
  5. // license information: https://github.com/AtomicGameEngine/AtomicGameEngine
  6. //
  7. #pragma once
  8. #include "AssetImporter.h"
  9. namespace Atomic
  10. {
  11. class Scene;
  12. }
  13. namespace ToolCore
  14. {
  15. class PrefabImporter : public AssetImporter
  16. {
  17. OBJECT(PrefabImporter);
  18. public:
  19. /// Construct.
  20. PrefabImporter(Context* context, Asset* asset);
  21. virtual ~PrefabImporter();
  22. virtual void SetDefaults();
  23. virtual bool Preload();
  24. /// Instantiate a node from the asset
  25. Node* InstantiateNode(Node* parent, const String& name);
  26. protected:
  27. bool Import();
  28. virtual bool LoadSettingsInternal(JSONValue& jsonRoot);
  29. virtual bool SaveSettingsInternal(JSONValue& jsonRoot);
  30. private:
  31. void HandlePrefabSave(StringHash eventType, VariantMap& eventData);
  32. SharedPtr<Atomic::Scene> preloadResourceScene_;
  33. };
  34. }