Canvas and UI Component #222
|
@ -31,7 +31,7 @@ namespace SHADE
|
|||
auto& children = sceneGraph.GetChildren(canvas.GetEID());
|
||||
for (auto& child : children)
|
||||
{
|
||||
RecurssiveUIComponentCheck(child);
|
||||
RecurssiveUIComponentCheck(child, canvas);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ namespace SHADE
|
|||
|
||||
}
|
||||
|
||||
void SHUISystem::AddUIComponentRoutine::RecurssiveUIComponentCheck(SHSceneNode* node) noexcept
|
||||
void SHUISystem::AddUIComponentRoutine::RecurssiveUIComponentCheck(SHSceneNode* node, SHCanvasComponent& canvas) noexcept
|
||||
{
|
||||
if (node == nullptr)
|
||||
return;
|
||||
|
@ -62,11 +62,15 @@ namespace SHADE
|
|||
|
||||
if(SHComponentManager::HasComponent<SHUIComponent>(eid) == false)
|
||||
SHComponentManager::AddComponent<SHUIComponent>(eid);
|
||||
else
|
||||
{
|
||||
SHComponentManager::GetComponent<SHUIComponent>(eid)->canvasID = canvas.GetEID();
|
||||
}
|
||||
|
||||
auto& children = SHSceneManager::GetCurrentSceneGraph().GetChildren(eid);
|
||||
for (auto& child : children)
|
||||
{
|
||||
RecurssiveUIComponentCheck(child);
|
||||
RecurssiveUIComponentCheck(child, canvas);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace SHADE
|
|||
|
||||
private:
|
||||
|
||||
void RecurssiveUIComponentCheck(SHSceneNode* node) noexcept;
|
||||
void RecurssiveUIComponentCheck(SHSceneNode* node, SHCanvasComponent& canvas) noexcept;
|
||||
};
|
||||
friend class AddUIComponentRoutine;
|
||||
|
||||
|
|
Loading…
Reference in New Issue