SoundAsset.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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>()
  19. ->Version(1)
  20. ->Field("Data", &SoundAsset::m_data)
  21. ;
  22. serializeContext->RegisterGenericType<AZ::Data::Asset<SoundAsset>>();
  23. if (auto* editContext = serializeContext->GetEditContext())
  24. {
  25. editContext->Class<SoundAsset>("MiniSound SoundAsset", "")
  26. ->ClassElement(AZ::Edit::ClassElements::EditorData, "");
  27. }
  28. }
  29. }
  30. } // namespace MiniAudio