AnimGraphAssetFactory.h 840 B

123456789101112131415161718192021222324252627282930
  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/std/smart_ptr/unique_ptr.h>
  10. #include <AzCore/Asset/AssetCommon.h>
  11. #include <Integration/Assets/AnimGraphAsset.h>
  12. namespace EMotionFX
  13. {
  14. class AnimGraph;
  15. class AnimGraphAssetFactory
  16. {
  17. public:
  18. static AZ::Data::Asset<EMotionFX::Integration::AnimGraphAsset> Create(const AZ::Data::AssetId id, AZStd::unique_ptr<AnimGraph> animGraph)
  19. {
  20. auto asset = AZ::Data::AssetManager::Instance().CreateAsset<Integration::AnimGraphAsset>(id);
  21. asset->SetData(animGraph.release());
  22. return asset;
  23. }
  24. };
  25. } // namespace EMotionFX