ProceduralAssetHandler.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/Asset/AssetManager.h>
  10. #include <AzCore/Memory/SystemAllocator.h>
  11. #include <AzCore/std/smart_ptr/shared_ptr.h>
  12. #include <AzCore/std/containers/vector.h>
  13. namespace AZ::Prefab
  14. {
  15. class PrefabGroupAssetHandler final
  16. : public AZ::Data::AssetHandler
  17. {
  18. public:
  19. AZ_CLASS_ALLOCATOR(PrefabGroupAssetHandler, AZ::SystemAllocator);
  20. PrefabGroupAssetHandler();
  21. ~PrefabGroupAssetHandler() override;
  22. static AZStd::string_view s_Extension;
  23. protected:
  24. AZ::Data::AssetData* CreateAsset(const AZ::Data::AssetId& id, const AZ::Data::AssetType& type) override;
  25. void DestroyAsset(AZ::Data::AssetData* ptr) override;
  26. void GetHandledAssetTypes(AZStd::vector<AZ::Data::AssetType>& assetTypes) override;
  27. AZ::Data::AssetHandler::LoadResult LoadAssetData(
  28. const AZ::Data::Asset<AZ::Data::AssetData>& asset,
  29. AZStd::shared_ptr<AZ::Data::AssetDataStream> stream,
  30. const AZ::Data::AssetFilterCB& assetLoadFilterCB) override;
  31. class AssetTypeInfoHandler;
  32. AZStd::shared_ptr<AssetTypeInfoHandler> m_assetTypeInfoHandler;
  33. };
  34. }