Commit 6839a58c by Tim Reiter

fixed level exporter bug (children of children) + reverted ground prefab

parent b37530c6
...@@ -2,29 +2,30 @@ ...@@ -2,29 +2,30 @@
<Levels> <Levels>
<Developer StartLevel="0" /> <Developer StartLevel="0" />
<Level> <Level>
<Item prefab="Start_Position" x="5" /> <Item prefab="Start_Position" x="5" y="0.31" />
<Item prefab="Start_Position" x="-5" /> <Item prefab="Start_Position" x="-5" y="0.31" />
<Item prefab="Start_Position" x="-2.5" /> <Item prefab="Start_Position" x="-2.5" y="0.31" />
<Item prefab="Start_Position" x="2.5" /> <Item prefab="Start_Position" x="2.5" y="0.31" />
<Item prefab="ground" y="-1.5" scalex="22.78" /> <Item prefab="ground" y="-1.19" scalex="22.78" />
<Item prefab="ground" x="-7.5" y="-0.38" rot="90" scalex="30" /> <Item prefab="ground" x="-7.5" y="-0.07" rot="90" scalex="30" />
<Item prefab="ground" x="7.5" y="-0.38" rot="90" scalex="30" /> <Item prefab="ground" x="7.5" y="-0.07" rot="90" scalex="30" />
<Item prefab="ground" x="4.69" y="-2.71" scalex="22.78" /> <Item prefab="ground" x="4.69" y="-2.4" scalex="22.78" />
<Item prefab="ground" x="-4.7" y="-2.7" scalex="22.78" /> <Item prefab="ground" x="-4.7" y="-2.39" scalex="22.78" />
<Item prefab="ground" y="-4" scalex="60" /> <Item prefab="ground" y="-3.69" scalex="60" />
<Item prefab="Turret" y="-0.59"> <Item prefab="Turret" y="-0.28">
<children prefab="TurretBase" y="3.11" rot="180" /> <children prefab="TurretBase" x="-0.72" y="3.27" rot="180" />
<children prefab="Cannon" y="3.07" rot="180" scaley="4.02" /> <children prefab="Cannon" x="-0.72" y="3.23" rot="180" scaley="4.02" />
<children prefab="TurretButton" x="0.1" y="-3.6" /> <children prefab="TurretButton" x="0.1" y="-3.29" />
</Item> </Item>
<Item prefab="ground" x="-6.2" y="1.15" scalex="10" /> <Item prefab="ground" x="-6.2" y="1.46" scalex="10" />
<Item prefab="ground" x="6.2" y="1.15" scalex="10" /> <Item prefab="ground" x="6.2" y="1.46" scalex="10" />
<Item prefab="PortableFire" x="-6.84" y="1.96" scalex="0.2" scaley="0.2"> <Item prefab="PortableFire" x="-6.84" y="2.27" scalex="0.2" scaley="0.2">
<children prefab="flame_a_0005" x="-6.84" y="1.96" scalex="2" scaley="2" /> <children prefab="flame_a_0005" x="-6.84" y="2.27" scalex="2" scaley="2" />
</Item> </Item>
<Item prefab="PortableFire" x="6.84" y="1.83" scalex="0.2" scaley="0.2"> <Item prefab="PortableFire" x="6.84" y="2.14" scalex="0.2" scaley="0.2">
<children prefab="flame_a_0005" x="6.84" y="1.83" scalex="2" scaley="2" /> <children prefab="flame_a_0005" x="6.84" y="2.14" scalex="2" scaley="2" />
</Item> </Item>
<Item prefab="ground" y="3.56" scalex="60" />
</Level> </Level>
<Level> <Level>
<Item prefab="Start_Position" x="5" /> <Item prefab="Start_Position" x="5" />
......
...@@ -144,7 +144,7 @@ public class DeserializedLevelsLoader ...@@ -144,7 +144,7 @@ public class DeserializedLevelsLoader
foreach (Transform t in newGameObject.GetComponentsInChildren<Transform>()) foreach (Transform t in newGameObject.GetComponentsInChildren<Transform>())
{ {
if (!(t.parent == null) && (!t.parent.name.Equals("XmlItems"))) if (!(t.parent == null) && (t.parent.name.Equals(item.prefab)))
{ {
foreach (ItemChildStruct child in item.children) //Ja das ist wahrscheinlich Laufzeitmig nicht ideal, aber die Arrays haben eh nur eine Hand viele Elemente foreach (ItemChildStruct child in item.children) //Ja das ist wahrscheinlich Laufzeitmig nicht ideal, aber die Arrays haben eh nur eine Hand viele Elemente
{ {
......
...@@ -55,7 +55,7 @@ public class DeserializedLevelsSaver ...@@ -55,7 +55,7 @@ public class DeserializedLevelsSaver
int k = 0; int k = 0;
foreach (Transform t in item.GetComponentsInChildren<Transform>()) foreach (Transform t in item.GetComponentsInChildren<Transform>())
{ {
if (!t.parent.name.Equals("XmlItemsToExport")) if (t.parent.name.Equals(item.name))
{ {
//GetComponentsInChildren gibt auch die Komponente aus dem Parent (also dem Objekt selbst) zurck //GetComponentsInChildren gibt auch die Komponente aus dem Parent (also dem Objekt selbst) zurck
DeserializedLevels.Item child = new DeserializedLevels.Item(); DeserializedLevels.Item child = new DeserializedLevels.Item();
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment