public void GenerateNewGrid() { if (_gameGridTiles != null) { DestroyMapData(); } _worldMap = FindObjectOfType <DynamicWorldMap>(); GenerateMapData(); GenerateMapTiles(); GenerateEnvironment(); //GenerateDeployPoint(); //GenerateStartingObjects(); //Array.Sort(newSegmentAfterCount); _pathFinder.AssignGridInfo(_currentGridInfo); if (newGameGrid != null) { newGameGrid(_currentGridInfo); } _gridCoords.AssignGridInfo(_currentGridInfo); _currentSpreadingRoutine = AnomalySpreadingTimer(); StartCoroutine(_currentSpreadingRoutine); //Debug.Log("New grid generated"); }
// Fonction qui détruit l'ancienne grille, si elle existe private void DestroyMapData() { foreach (var gridTile in _gameGridTiles) { Destroy(gridTile.gameObject); } _allStaticObjects.Clear(); _allAnomalySegments.Clear(); _allAnomalyPatches.Clear(); _anomalyCompletedTileCount = 0; _worldMap = null; if (_currentSpreadingRoutine != null) { StopCoroutine(_currentSpreadingRoutine); _currentSpreadingRoutine = null; } if (gridDataDestroyed != null) { gridDataDestroyed(); } }