protected override void OnLoadLevel(int level, GridInfo gridInfo)
        {
            UnityMap2DUtil.CheckLoadTileIDMap();
            var tileInfo = GetMapInfo(TilemapUtil.TileMapName_BornPos);
            var campPoss = tileInfo.GetAllTiles(TilemapUtil.TileID_Camp);

            Debug.Assert(campPoss != null && campPoss.Count == 1, "campPoss!= null&& campPoss.Count == 1");
            campPos         = campPoss[0];
            enemyBornPoints = tileInfo.GetAllTiles(TilemapUtil.TileID_BornPosEnemy);
            playerBornPoss  = tileInfo.GetAllTiles(TilemapUtil.TileID_BornPosHero);
            var _gameConstStateService = GetService <IGameConstStateService>();

            if (_gameConstStateService != null)
            {
                _gameConstStateService.MapMin          = mapDataMin;
                _gameConstStateService.MapMax          = mapDataMax;
                _gameConstStateService.EnemyBornPoints = enemyBornPoints;
                _gameConstStateService.PlayerBornPoss  = playerBornPoss;
                _gameConstStateService.CampPos         = campPos;
            }

            EventHelper.Trigger(EEvent.LevelLoadProgress, 0.5f);
            UnityMap2DUtil.BindMapView(grid, gridInfo);
            EventHelper.Trigger(EEvent.LevelLoadProgress, 1f);
            EventHelper.Trigger(EEvent.LevelLoadDone, level);
        }
Ejemplo n.º 2
0
        protected override void OnLoadLevel(int level, GridInfo gridInfo)
        {
            UnityMap2DUtil.CheckLoadTileIDMap();

            EventHelper.Trigger(EEvent.LevelLoadProgress, 0.5f);
            UnityMap2DUtil.BindMapView(grid, gridInfo);
            EventHelper.Trigger(EEvent.LevelLoadProgress, 1f);
            EventHelper.Trigger(EEvent.LevelLoadDone, level);
        }