LoggingGroupBehavior.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 <SceneAPI/SceneCore/Components/BehaviorComponent.h>
  10. #include <SceneAPI/SceneCore/Events/ManifestMetaInfoBus.h>
  11. #include <SceneAPI/SceneCore/Events/AssetImportRequest.h>
  12. namespace SceneLoggingExample
  13. {
  14. // The LoggingGroupBehavior shows how a behavior can be written that monitors
  15. // manifest activity and reacts to it in order to setup default values for
  16. // manifest entries. It also demonstrates how to register new UI elements with
  17. // the SceneAPI.
  18. class LoggingGroupBehavior
  19. : public AZ::SceneAPI::SceneCore::BehaviorComponent
  20. , public AZ::SceneAPI::Events::ManifestMetaInfoBus::Handler
  21. , public AZ::SceneAPI::Events::AssetImportRequestBus::Handler
  22. {
  23. public:
  24. AZ_COMPONENT(LoggingGroupBehavior, "{4DE18DD7-5C40-4A14-8CD7-67162171DCAA}", AZ::SceneAPI::SceneCore::BehaviorComponent);
  25. ~LoggingGroupBehavior() override = default;
  26. void Activate() override;
  27. void Deactivate() override;
  28. static void Reflect(AZ::ReflectContext* context);
  29. void GetCategoryAssignments(CategoryRegistrationList& categories, const AZ::SceneAPI::Containers::Scene& scene) override;
  30. AZ::SceneAPI::Events::ProcessingResult UpdateManifest(AZ::SceneAPI::Containers::Scene& scene,
  31. ManifestAction action, RequestingApplication requester) override;
  32. void InitializeObject(const AZ::SceneAPI::Containers::Scene& scene, AZ::SceneAPI::DataTypes::IManifestObject& target) override;
  33. void GetPolicyName(AZStd::string& result) const override
  34. {
  35. result = "LoggingGroupBehavior";
  36. }
  37. private:
  38. static constexpr int s_loggingPreferredTabOrder{ 10 };
  39. };
  40. } // namespace SceneLoggingExample