Prefab
프리팹 생성 (CreatePrefabFromGameObject)
void GUIManager::CreatePrefabFromGameObject(const string& objectName)
{
// Scene XML 로드
wstring scenePath = L"Resource/Scene/" + SCENE.GetActiveScene()->GetSceneName() + L".xml";
tinyxml2::XMLDocument sceneDoc;
if (sceneDoc.LoadFile(Utils::ToString(scenePath).c_str()) != tinyxml2::XML_SUCCESS)
return;
// Prefab XML 문서 생성
tinyxml2::XMLDocument prefabDoc;
tinyxml2::XMLElement* prefabRoot = prefabDoc.NewElement("Prefab");
prefabDoc.InsertFirstChild(prefabRoot);
// 재귀적으로 게임 오브젝트 처리하는 savePrefab 함수 정의...프리팹 로드 (LoadPrefabToScene)
프리팹 시스템의 핵심 기술적 요소
Last updated