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