ParticleEffectImporter.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. #include <Atomic/Resource/ResourceCache.h>
  8. #include <Atomic/Resource/Image.h>
  9. #include <Atomic/Atomic3D/ParticleEffect.h>
  10. #include "Asset.h"
  11. #include "AssetDatabase.h"
  12. #include "ParticleEffectImporter.h"
  13. namespace ToolCore
  14. {
  15. ParticleEffectImporter::ParticleEffectImporter(Context* context, Asset *asset) : AssetImporter(context, asset)
  16. {
  17. }
  18. ParticleEffectImporter::~ParticleEffectImporter()
  19. {
  20. }
  21. void ParticleEffectImporter::SetDefaults()
  22. {
  23. AssetImporter::SetDefaults();
  24. }
  25. bool ParticleEffectImporter::Import()
  26. {
  27. return true;
  28. }
  29. bool ParticleEffectImporter::LoadSettingsInternal(JSONValue& jsonRoot)
  30. {
  31. if (!AssetImporter::LoadSettingsInternal(jsonRoot))
  32. return false;
  33. JSONValue import = jsonRoot.Get("ParticleEffectImporter");
  34. return true;
  35. }
  36. bool ParticleEffectImporter::SaveSettingsInternal(JSONValue& jsonRoot)
  37. {
  38. if (!AssetImporter::SaveSettingsInternal(jsonRoot))
  39. return false;
  40. JSONValue import(JSONValue::emptyObject);
  41. jsonRoot.Set("ParticleEffectImporter", import);
  42. return true;
  43. }
  44. Resource* ParticleEffectImporter::GetResource(const String& typeName)
  45. {
  46. ResourceCache* cache = GetSubsystem<ResourceCache>();
  47. ParticleEffect* particleEffect = cache->GetResource<ParticleEffect>(asset_->GetPath());
  48. return particleEffect;
  49. }
  50. }