Skip to content

Commit

Permalink
fix DEXP-481931
Browse files Browse the repository at this point in the history
  • Loading branch information
krasnotsvetov committed Oct 9, 2019
1 parent 64ab191 commit bb8ba2b
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static SceneHierarchy Read(UnsafeReader reader)
public void AddSceneHierarchyElement(Dictionary<string, string> simpleValues, Dictionary<string, FileID> referenceValues)
{
var anchor = simpleValues.GetValueSafe("&anchor");
if (anchor == null)
if (string.IsNullOrEmpty(anchor))
return;

var id = new FileID(null, anchor);
Expand All @@ -61,8 +61,7 @@ public void AddSceneHierarchyElement(Dictionary<string, string> simpleValues, Di
var gameObject = referenceValues.GetValueSafe(UnityYamlConstants.GameObjectProperty);
var father = referenceValues.GetValueSafe(UnityYamlConstants.FatherProperty);

Elements.Add(id, new TransformHierarchyElement(id, correspondingId,
prefabInstanceId, isStripped, rootOrder, gameObject, father));
Elements[id] = new TransformHierarchyElement(id, correspondingId,prefabInstanceId, isStripped, rootOrder, gameObject, father);

if (Elements.TryGetValue(gameObject, out var element))
{
Expand All @@ -78,7 +77,7 @@ public void AddSceneHierarchyElement(Dictionary<string, string> simpleValues, Di
{
// component
var gameObject = referenceValues.GetValueSafe(UnityYamlConstants.GameObjectProperty);
Elements.Add(id, new ComponentHierarchyElement(id, correspondingId, prefabInstanceId, gameObject, isStripped));
Elements[id] = new ComponentHierarchyElement(id, correspondingId, prefabInstanceId, gameObject, isStripped);
}
else
{
Expand All @@ -87,8 +86,8 @@ public void AddSceneHierarchyElement(Dictionary<string, string> simpleValues, Di
if (transformId != null)
myGameObjectsTransforms.Remove(transformId);

Elements.Add(id, new GameObjectHierarchyElement(id, correspondingId, prefabInstanceId, isStripped, transformId,
simpleValues.GetValueSafe(UnityYamlConstants.NameProperty)));
Elements[id] = new GameObjectHierarchyElement(id, correspondingId, prefabInstanceId, isStripped, transformId,
simpleValues.GetValueSafe(UnityYamlConstants.NameProperty));
}
}

Expand Down Expand Up @@ -149,8 +148,7 @@ public void AddPrefabModification(IBuffer buffer)
var rootIndexes = new Dictionary<FileID, int?>();
GetModifications(buffer, lexer, indentSize, names, rootIndexes);
var id = new FileID(null, anchor);
Elements.Add(id,
new ModificationHierarchyElement(id, null, null, false, transformParentId, rootIndexes, names));
Elements[id] = new ModificationHierarchyElement(id, null, null, false, transformParentId, rootIndexes, names);
return;
}
}
Expand Down

0 comments on commit bb8ba2b

Please sign in to comment.