コード例 #1
0
        public void SaveMapButtonClick(HUD invoker)
        {
            if (namingTextbox.textRenderer.text == "")
            {
                return;
            }
            LevelDescription ld = new LevelDescription();

            ld.PlayerStartPoint = playerStartPointMaker.transformation.Position;
            List <GameObject> enemySpawnPoints = FindObjectsByTag("EnemySpawnPoint");

            foreach (GameObject enemySpawnPoint in enemySpawnPoints)
            {
                ld.SpawnPoints.Add(enemySpawnPoint.transformation.Position);
            }
            ld.MapCellSize    = 10;
            ld.MapDeltaHeight = 200;
            ld.TerrainName    = terrainName;
            ld.SaveToXML(Game.Content.RootDirectory + @"\Level\" + namingTextbox.textRenderer.text + ".xml");

            gameManager.isPaused = false;
            gameManager.LoadTitleScreen();
        }