SpiecsEngine
 
Loading...
Searching...
No Matches

◆ SetMaterial()

void Spices::SpriteComponent::SetMaterial ( const std::string & materialPath)

Set Sprite Material.

Parameters
[in]materialPathSprite Material Path.

Definition at line 25 of file SpriteComponent.cpp.

26 {
28
29 auto& e = FrameInfo::Get().m_World->QueryEntitybyID((uint32_t)m_Owner);
30
31 m_Mesh->GetPacks().for_each([&](auto& k, auto& v) {
32 v->SetMaterial(materialPath);
33 v->GetMeshDesc().UpdatemodelAddress(e.GetComponent<TransformComponent>().GetModelBufferAddress());
34 v->GetMeshDesc().UpdateentityID((uint32_t)m_Owner);
35 return false;
36 });
37 }
#define SPICES_PROFILE_ZONE
entt::entity m_Owner
This component's Owner entity.
Definition Component.h:67
static FrameInfo & Get()
Get FrameInfo.
Definition FrameInfo.cpp:14
std::shared_ptr< World > m_World
The shared pointer of specific world.
Definition FrameInfo.h:94
std::shared_ptr< Mesh > m_Mesh
The Mesh this component handled.

Referenced by Spices::GameEditorWorld::OnPreActivate().