checkpoint: commit current workspace state

This commit is contained in:
2026-04-25 16:11:01 +08:00
parent 6d43fe5a7d
commit 6002d86a7e
449 changed files with 11303 additions and 100602 deletions

View File

@@ -1,4 +1,4 @@
#include "Scene/EditorSceneRuntime.h"
#include "Scene/EditorSceneRuntime.h"
#include <XCEngine/Components/ComponentFactoryRegistry.h>
#include <XCEngine/Components/CameraComponent.h>
@@ -501,17 +501,17 @@ bool EditorSceneRuntime::MoveGameObjectToRoot(std::string_view itemId) {
bool EditorSceneRuntime::AddComponentToSelectedGameObject(
std::string_view componentTypeName) {
if (componentTypeName.empty()) {
return AddComponentToGameObject(GetSelectedItemId(), componentTypeName);
}
bool EditorSceneRuntime::AddComponentToGameObject(
std::string_view itemId,
std::string_view componentTypeName) {
if (itemId.empty() || componentTypeName.empty()) {
return false;
}
const std::optional<GameObject::ID> selectedId = GetSelectedGameObjectId();
Scene* scene = GetActiveScene();
if (!selectedId.has_value() || scene == nullptr) {
return false;
}
GameObject* gameObject = scene->FindByID(selectedId.value());
GameObject* gameObject = FindGameObject(itemId);
if (gameObject == nullptr) {
return false;
}
@@ -1071,3 +1071,4 @@ void EditorSceneRuntime::ClearInvalidToolInteractionState() {
}
} // namespace XCEngine::UI::Editor::App