public void Load() { currentXDocument = null; XDocument xml = TryReadFromStreamingAsset(mapName); if (xml != null) { try { targetTerrain.ClearTerrain(); currentXDocument = xml; XElement xterrain = xml.Root.Element("terrain"); if (xterrain != null) { ReadTerrainData(xterrain); } targetTerrain.Create(); } catch (Exception e) { print(e.ToString()); targetTerrain.Create(); } } }
public void ReadDataFor(BaseHexTerrain terrain) { targetTerrain = terrain; XDocument xml = TryReadFrom(mapName); if (xml != null) { targetTerrain.ClearTerrain(); currentXDocument = xml; ReadHeightMap(); ReadLayers(); print("Reading map was successfull"); } }