本文整理汇总了C#中LevelManager.SaveLevelToXml方法的典型用法代码示例。如果您正苦于以下问题:C# LevelManager.SaveLevelToXml方法的具体用法?C# LevelManager.SaveLevelToXml怎么用?C# LevelManager.SaveLevelToXml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LevelManager
的用法示例。
在下文中一共展示了LevelManager.SaveLevelToXml方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateLevelFromJavatoXml
//.........这里部分代码省略.........
BlockTeleportation telBlock = new BlockTeleportation();
if (bl == 6)
{
telBlock.PosX = x;
telBlock.PosY = (this.rows - 1) - y;
telBlock.PosZ = 0;
telBlock.teleportToX = -20;
telBlock.teleportToY = -20;
telBlock.teleportToZ = 0;
}
switch (bl)
{
case 1:
blockBlock.TypeOfBlock = TypeOfBlock.BLOCK;
level.blocksList.Add(blockBlock);
break;
case 2:
blockBlock.TypeOfBlock = TypeOfBlock.PATH;
level.blocksList.Add(blockBlock);
break;
case 3:
blockBlock.TypeOfBlock = TypeOfBlock.BROKEN;
level.blocksList.Add(blockBlock);
break;
case 4:
blockBlock.TypeOfBlock = TypeOfBlock.START;
level.blocksList.Add(blockBlock);
break;
case 5:
blockBlock.TypeOfBlock = TypeOfBlock.EXIT;
level.blocksList.Add(blockBlock);
break;
case 6:
blockBlock.TypeOfBlock = TypeOfBlock.TELEPORT;
level.blocksList.Add(blockBlock);
level.blTeleportsList.Add(telBlock);
break;
case 7:
blockBlock.TypeOfBlock = TypeOfBlock.LOCK_GREEN;
level.blocksList.Add(blockBlock);
break;
case 8:
blockBlock.TypeOfBlock = TypeOfBlock.LOCK_RED;
level.blocksList.Add(blockBlock);
break;
case 9:
blockBlock.TypeOfBlock = TypeOfBlock.MOVE_UP;
level.blocksList.Add(blockBlock);
break;
case 10:
blockBlock.TypeOfBlock = TypeOfBlock.MOVE_RIGHT;
level.blocksList.Add(blockBlock);
break;
case 11:
blockBlock.TypeOfBlock = TypeOfBlock.MOVE_DOWN;
level.blocksList.Add(blockBlock);
break;
case 12:
blockBlock.TypeOfBlock = TypeOfBlock.MOVE_LEFT;
level.blocksList.Add(blockBlock);
break;
case 13:
blockBlock.TypeOfBlock = TypeOfBlock.MOVE_UP_DOWN;
level.blocksList.Add(blockBlock);
break;
case 14:
blockBlock.TypeOfBlock = TypeOfBlock.MOVE_LEFT_RIGHT;
level.blocksList.Add(blockBlock);
break;
case 15:
blockBlock.TypeOfBlock = TypeOfBlock.MOVE_ALL;
level.blocksList.Add(blockBlock);
break;
case 16:
blockBlock.TypeOfBlock = TypeOfBlock.KEY_GREEN;
level.blocksList.Add(blockBlock);
break;
case 17:
blockBlock.TypeOfBlock = TypeOfBlock.KEY_RED;
level.blocksList.Add(blockBlock);
break;
case 18:
blockBlock.TypeOfBlock = TypeOfBlock.TIME;
level.blocksList.Add(blockBlock);
break;
}
}
}
}
LevelManager levelManager = new LevelManager(level);
levelManager.SaveLevelToXml("Level" + i.ToString() + ".xml");
}
}