public void Generate() { if (mapWidth <= 0 || mapHeight <= 0) { Debug.Log("Please enter values greator than zero for the height and width"); } else { FileStream stream = new FileStream("Assets/Resources/TileData/Test.XML", FileMode.Open); XmlSerializer serializer = new XmlSerializer(typeof(List <TileTemplate>)); List <TileTemplate> tiles = (List <TileTemplate>)serializer.Deserialize(stream); if (tiles.Count >= 1) { map = TileStats.GenerateBaseMap(mapWidth, mapHeight, Ground, tiles[0]); UIController.SetBool("Map Generated", true); cam.Center(Ground); //Maybe find somwhere else to handle the transition selecter = Selecter.createSelector(map, selectSpace); } else { Debug.Log("No Tile Data set found!"); } } }
void Start() { //Temp map generation FileStream stream = new FileStream("Assets/Resources/TileData/Test.XML", FileMode.Open); XmlSerializer serializer = new XmlSerializer(typeof(List <TileTemplate>)); List <TileTemplate> tiles = (List <TileTemplate>)serializer.Deserialize(stream); map = TileStats.GenerateBaseMap(mapWidth, mapHeight, Ground, tiles[0]); //Place Creatures on the map player.PlayerBoot(); enemy.PlayerBoot(); //Temp Action Generation actionList = new List <Action>(); actionList.Add(new Action("Attack", AttackAction)); actionList.Add(new Action("Move", MoveAction)); buttons = new List <GameObject>(); //Debug.Log(actionList); generateActions(); }