-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOutlineComponent.cpp
More file actions
33 lines (30 loc) · 907 Bytes
/
Copy pathOutlineComponent.cpp
File metadata and controls
33 lines (30 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "Component/OutlineComponent.h"
#include "Game/GameObject.h"
namespace sh::editor
{
OutlineComponent::OutlineComponent(game::GameObject& owner) :
game::MeshRenderer(owner)
{
mats.push_back(static_cast<render::Material*>(core::SObjectManager::GetInstance()->GetSObject(core::UUID{ "bbc4ef7ec45dce223297a224f8093f13" })));
assert(mats[0]);
renderer = owner.GetComponent<MeshRenderer>();
canPlayInEditor = true;
}
SH_EDITOR_API void OutlineComponent::BeginUpdate()
{
if (!core::IsValid(renderer))
renderer = gameObject.GetComponent<MeshRenderer>();
if (!core::IsValid(renderer))
return;
if (GetMesh() != renderer->GetMesh())
SetMesh(renderer->GetMesh());
}
SH_EDITOR_API auto OutlineComponent::Serialize() const -> core::Json
{
return core::Json{};
}
SH_EDITOR_API void OutlineComponent::CreateDrawable(bool)
{
Super::CreateDrawable(false);
}
}//namespace