EditorStarsComponent.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 <Atom/Feature/Utils/EditorRenderComponentAdapter.h>
  10. #include <StarsComponent.h>
  11. namespace AZ::Render
  12. {
  13. class EditorStarsComponent final
  14. : public EditorRenderComponentAdapter<StarsComponentController, StarsComponent, StarsComponentConfig>
  15. {
  16. public:
  17. using BaseClass = EditorRenderComponentAdapter<StarsComponentController, StarsComponent, StarsComponentConfig>;
  18. AZ_EDITOR_COMPONENT(AZ::Render::EditorStarsComponent, EditorStarsComponentTypeId, BaseClass);
  19. static void Reflect(AZ::ReflectContext* context);
  20. EditorStarsComponent() = default;
  21. protected:
  22. void Init() override;
  23. private:
  24. //! EditorRenderComponentAdapter
  25. //! we override OnConfigurationChanged to avoid deactivating and activating unnecessarily
  26. AZ::u32 OnConfigurationChanged() override;
  27. void OnEntityVisibilityChanged(bool visibility) override;
  28. AZ::Data::AssetId m_prevAssetId;
  29. AZStd::string m_defaultAssetPath{ "stars/default.stars" };
  30. };
  31. } // namespace AZ::Render