3
0

SoundAsset.cpp 1.0 KB

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. #include <AzCore/Asset/AssetSerializer.h>
  9. #include <AzCore/Serialization/EditContext.h>
  10. #include <AzCore/Serialization/SerializeContext.h>
  11. #include <MiniAudio/SoundAsset.h>
  12. namespace MiniAudio
  13. {
  14. void SoundAsset::Reflect(AZ::ReflectContext* context)
  15. {
  16. if (auto* serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
  17. {
  18. serializeContext->Class<SoundAsset, AZ::Data::AssetData>()->Version(1)->Field("Data", &SoundAsset::m_data);
  19. serializeContext->RegisterGenericType<AZ::Data::Asset<SoundAsset>>();
  20. if (auto* editContext = serializeContext->GetEditContext())
  21. {
  22. editContext->Class<SoundAsset>("MiniSound SoundAsset", "")->ClassElement(AZ::Edit::ClassElements::EditorData, "");
  23. }
  24. }
  25. }
  26. } // namespace MiniAudio