AkUnrealAssetDataHelper.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*******************************************************************************
  2. The content of this file includes portions of the proprietary AUDIOKINETIC Wwise
  3. Technology released in source code form as part of the game integration package.
  4. The content of this file may not be used without valid licenses to the
  5. AUDIOKINETIC Wwise Technology.
  6. Note that the use of the game engine is subject to the Unreal(R) Engine End User
  7. License Agreement at https://www.unrealengine.com/en-US/eula/unreal
  8. License Usage
  9. Licensees holding valid licenses to the AUDIOKINETIC Wwise Technology may use
  10. this file in accordance with the end user license agreement provided with the
  11. software or, alternatively, in accordance with the terms contained
  12. in a written agreement between you and Audiokinetic Inc.
  13. Copyright (c) 2023 Audiokinetic Inc.
  14. *******************************************************************************/
  15. #pragma once
  16. #include "WwiseUEFeatures.h"
  17. #include "WwiseItemType.h"
  18. #include "AssetRegistry/AssetData.h"
  19. class FWwiseAnyRef;
  20. namespace AkUnrealAssetDataHelper
  21. {
  22. WWISERECONCILE_API bool IsSameType(const FAssetData& AssetData, EWwiseItemType::Type ItemType);
  23. WWISERECONCILE_API FName GetUClassName(EWwiseItemType::Type ItemType);
  24. // Gets the AssetClass prior to UE 5.1, otherwise the AssetClassPath
  25. WWISERECONCILE_API FName GetAssetClassName(const FAssetData& AssetData);
  26. WWISERECONCILE_API bool IsAssetAkAudioType(const FAssetData& AssetData);
  27. WWISERECONCILE_API bool IsAssetTransient(const FAssetData& AssetData);
  28. // Sets the AssetClass prior to UE 5.1, otherwise the AssetClassPath
  29. WWISERECONCILE_API void SetAssetClassName(FAssetData& AssetData, UClass* Class);
  30. WWISERECONCILE_API FString GetAssetDefaultPackagePath(const FAssetData& AssetData);
  31. WWISERECONCILE_API FString GetAssetDefaultPackagePath(const FWwiseAnyRef* WwiseRef);
  32. WWISERECONCILE_API FName GetAssetDefaultName(const FAssetData& AssetData);
  33. WWISERECONCILE_API FName GetAssetDefaultName(const FWwiseAnyRef* WwiseRef);
  34. template <typename T>
  35. bool AssetOfType(const FAssetData& AssetData)
  36. {
  37. #if UE_5_1_OR_LATER
  38. return AssetData.AssetClassPath == T::StaticClass()->GetClassPathName();
  39. #else
  40. return AssetData.AssetClass == T::StaticClass()->GetFName();
  41. #endif
  42. }
  43. }