Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #ifndef MESHCOMPOSEDCOMPONENT_H
- #define MESHCOMPOSEDCOMPONENT_H
- #include <AzCore/Component/Component.h>
- #include <LmbrCentral\Rendering\MeshComponentBus.h>
- #include <LmbrCentral/Rendering/MeshAsset.h>
- #include <LmbrCentral/Rendering/MaterialAsset.h>
- #include <AzCore/Asset/AssetCommon.h>
- //EBUS
- #include <AzCore/Component/EntityBus.h>
- // LyTanksHeaders
- namespace LyTanks
- {
- class MeshComposedComponent
- : public AZ::Component
- , public AZ::TickBus::Handler
- , public AZ::EntityBus::MultiHandler
- {
- public:
- enum TypeElement : AZ::u8
- {
- ELEMENT_1,
- ELEMENT_2,
- ELEMENT_3,
- ELEMENT_4,
- ELEMENT_5,
- MAX_ELEMENT
- };
- AZ_COMPONENT(MeshComposedComponent, "{2DC48F62-F516-49B1-B061-606FE9726A2E}", AZ::Component);
- MeshComposedComponent() {};
- virtual ~MeshComposedComponent() {};
- // AZ::Component
- static void Reflect(AZ::ReflectContext* context);
- void Init() override;
- void Activate() override;
- void Deactivate() override;
- // AZ::TickBus
- void OnTick(float deltaTime, AZ::ScriptTimePoint time);
- // EntityBus
- void OnEntityActivated(const AZ::EntityId& entityId) override;
- void OnEntityDeactivated(const AZ::EntityId& entityId) override;
- protected:
- void InitializeChildEntities();
- void LoadMeshAsset();
- AZ::Data::Asset<LmbrCentral::MeshAsset> meshAsset;
- using MaterialPtr = _smart_ptr < IMaterial >;
- MaterialPtr m_materialOverride;
- bool m_isInitialized = false;
- AZStd::vector<AZStd::shared_ptr<AZ::Entity> > m_childs;
- AZStd::vector<AZ::Vector3> m_childsPosition;
- AZStd::vector<float> m_childsPhase;
- };
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement