TranslationBuilderComponent.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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/Component/Component.h>
  10. #include <AssetBuilderSDK/AssetBuilderBusses.h>
  11. #include <AssetBuilderSDK/AssetBuilderSDK.h>
  12. namespace TranslationBuilder
  13. {
  14. //! Here is an example of a builder worker that actually performs the building of assets.
  15. //! In this example, we only register one, but you can have as many different builders in a single builder module as you want.
  16. class TranslationBuilderWorker
  17. : public AssetBuilderSDK::AssetBuilderCommandBus::Handler // this will deliver you the "shut down!" message on another thread.
  18. {
  19. public:
  20. //! Asset Builder Callback Functions
  21. void CreateJobs(const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response);
  22. void ProcessJob(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) const;
  23. //////////////////////////////////////////////////////////////////////////
  24. //!AssetBuilderSDK::AssetBuilderCommandBus interface
  25. void ShutDown() override; // if you get this you must fail all existing jobs and return.
  26. //////////////////////////////////////////////////////////////////////////
  27. static AZ::Uuid GetUUID();
  28. private:
  29. AZStd::string FindLReleaseTool() const;
  30. private:
  31. bool m_isShuttingDown = false;
  32. };
  33. //! Here's an example of the lifecycle Component you must implement.
  34. //! You must have at least one component to handle the lifecycle of your module.
  35. //! You could make this also be a builder if you also listen to the builder bus, and register itself as a builder
  36. //! But for the purposes of clarity, we will make it just be the lifecycle component in this example plugin
  37. class BuilderPluginComponent
  38. : public AZ::Component
  39. {
  40. public:
  41. AZ_COMPONENT(BuilderPluginComponent, "{61560B47-39B8-43DD-ACBE-956ECFF9C414}")
  42. static void Reflect(AZ::ReflectContext* context);
  43. //////////////////////////////////////////////////////////////////////////
  44. // AZ::Component
  45. void Activate() override; // reach out to the outside world and connect up to what you need to, register things, etc.
  46. void Deactivate() override; // unregister things, disconnect from the outside world
  47. //////////////////////////////////////////////////////////////////////////
  48. private:
  49. TranslationBuilderWorker m_builderWorker;
  50. };
  51. }