Exemplo n.º 1
0
 public void LoadMapData()
 {
     if (string.IsNullOrEmpty(MAP_ASSET) == false)
     {
         this.m_MapParsed = CMapParser.parseMap(MAP_ASSET);
         // GAME
         this.m_LimitRotate = this.m_MapParsed.limit;
         // GRID
         this.m_Width  = this.m_MapParsed.map.GetLength(0);
         this.m_Height = this.m_MapParsed.map.GetLength(1);
         this.m_Grid   = new int[this.m_Width, this.m_Height];
         System.Buffer.BlockCopy(this.m_MapParsed.map, 0, this.m_Grid, 0, this.m_MapParsed.map.Length * sizeof(int));
         // CLOUD
         this.m_CloudGroups = new CMapParser.CMapFullInfo.CCloudInfo[this.m_MapParsed.clouds.Length];
         System.Array.Copy(this.m_MapParsed.clouds, this.m_CloudGroups, this.m_MapParsed.clouds.Length);
         // FOLDER
         Color cameraBackground;
         if (ColorUtility.TryParseHtmlString(this.m_MapParsed.backgroundColor, out cameraBackground))
         {
             Camera.main.backgroundColor = cameraBackground;
         }
         this.m_TileBorderFolder = this.m_MapParsed.tileBorderFolder;
         this.m_TileFolder       = this.m_MapParsed.tileFolder;
         this.m_MarkerFolder     = this.m_MapParsed.markerFolder;
         this.m_CloudFolder      = this.m_MapParsed.cloudFolder;
         this.m_RainFolder       = this.m_MapParsed.rainFolder;
     }
 }
Exemplo n.º 2
0
    public void LoadMapDataWithAsset()
    {
        if (this.m_MapAsset == null)
        {
            return;
        }
        var mapAsset = this.m_MapAsset;

        this.m_MapFullInfo = CMapParser.parseMap(mapAsset.text);
        // GAME
        this.m_MapName     = this.m_MapFullInfo.name;
        this.m_MapHard     = this.m_MapFullInfo.hard;
        this.m_LimitRotate = this.m_MapFullInfo.limit;
        Color cameraBackground;

        if (ColorUtility.TryParseHtmlString(this.m_MapFullInfo.backgroundColor, out cameraBackground))
        {
            Camera.main.backgroundColor = cameraBackground;
        }
        this.m_TileBorderFolder = this.m_MapFullInfo.tileBorderFolder;
        this.m_TileFolder       = this.m_MapFullInfo.tileFolder;
        this.m_MarkerFolder     = this.m_MapFullInfo.markerFolder;
        this.m_CloudFolder      = this.m_MapFullInfo.cloudFolder;
        this.m_RainFolder       = this.m_MapFullInfo.rainFolder;
        // GRID
        this.m_Width  = this.m_MapFullInfo.map.GetLength(0);
        this.m_Height = this.m_MapFullInfo.map.GetLength(1);
        this.m_Grid   = new int[this.m_Width, this.m_Height];
        System.Buffer.BlockCopy(this.m_MapFullInfo.map, 0, this.m_Grid, 0, this.m_MapFullInfo.map.Length * sizeof(int));
        // CLOUD
        this.m_CloudGroups = new CMapParser.CMapFullInfo.CCloudInfo[this.m_MapFullInfo.clouds.Length];
        System.Array.Copy(this.m_MapFullInfo.clouds, this.m_CloudGroups, this.m_MapFullInfo.clouds.Length);
        // GENARATE
        this.GenerateCloudGroup();
        this.GenerateMarker();
    }