engine: sync editor rendering and ui changes

This commit is contained in:
2026-04-08 16:09:15 +08:00
parent 31756847ab
commit 162f1cc12e
153 changed files with 4454 additions and 2990 deletions

View File

@@ -72,17 +72,60 @@ inline ::XCEngine::Components::GameObject* CreateLightEntity(
IEditorContext& context,
::XCEngine::Components::GameObject* parent = nullptr,
const std::string& commandLabel = "Create Light",
const std::string& entityName = "Light") {
const std::string& entityName = "Light",
::XCEngine::Components::LightType lightType = ::XCEngine::Components::LightType::Directional) {
return CreateEntity(
context,
commandLabel,
entityName,
parent,
[](::XCEngine::Components::GameObject& entity, ISceneManager&) {
entity.AddComponent<::XCEngine::Components::LightComponent>();
[lightType](::XCEngine::Components::GameObject& entity, ISceneManager&) {
auto* light = entity.AddComponent<::XCEngine::Components::LightComponent>();
if (light != nullptr) {
light->SetLightType(lightType);
}
});
}
inline ::XCEngine::Components::GameObject* CreateDirectionalLightEntity(
IEditorContext& context,
::XCEngine::Components::GameObject* parent = nullptr,
const std::string& commandLabel = "Create Directional Light",
const std::string& entityName = "Directional Light") {
return CreateLightEntity(
context,
parent,
commandLabel,
entityName,
::XCEngine::Components::LightType::Directional);
}
inline ::XCEngine::Components::GameObject* CreatePointLightEntity(
IEditorContext& context,
::XCEngine::Components::GameObject* parent = nullptr,
const std::string& commandLabel = "Create Point Light",
const std::string& entityName = "Point Light") {
return CreateLightEntity(
context,
parent,
commandLabel,
entityName,
::XCEngine::Components::LightType::Point);
}
inline ::XCEngine::Components::GameObject* CreateSpotLightEntity(
IEditorContext& context,
::XCEngine::Components::GameObject* parent = nullptr,
const std::string& commandLabel = "Create Spot Light",
const std::string& entityName = "Spot Light") {
return CreateLightEntity(
context,
parent,
commandLabel,
entityName,
::XCEngine::Components::LightType::Spot);
}
inline ::XCEngine::Components::GameObject* CreatePrimitiveEntity(
IEditorContext& context,
::XCEngine::Resources::BuiltinPrimitiveType primitiveType,