mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-20 20:55:50 +00:00
Support changing instance ClassName
This commit is contained in:
@@ -100,7 +100,13 @@ end
|
||||
local function reconcile(instanceData, instanceMap, instanceMetadataMap, id, existingInstance)
|
||||
local data = instanceData[id]
|
||||
|
||||
assert(data.ClassName == existingInstance.ClassName)
|
||||
if data.ClassName ~= existingInstance.ClassName then
|
||||
-- TODO: Preserve existing children instead?
|
||||
local parent = existingInstance.Parent
|
||||
instanceMap:destroyId(id)
|
||||
reify(instanceData, instanceMap, instanceMetadataMap, id, parent)
|
||||
return
|
||||
end
|
||||
|
||||
for key, value in pairs(data.Properties) do
|
||||
setProperty(existingInstance, key, value.Value)
|
||||
|
||||
Reference in New Issue
Block a user