コード例 #1
0
ファイル: MapDAO.cs プロジェクト: alu0100888157/Tilesets
        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();
                }
            }
        }
コード例 #2
0
        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");
            }
        }