private void OnDestroy() { foreach (var orientationData in UnrenderedOrientationData) { ReleaseOrientationData(orientationData); } if (orientationMesh != null) { orientationMesh.Clear(); HexMeshFactory.Destroy(orientationMesh); } if (weightsMesh != null) { weightsMesh.Clear(); HexMeshFactory.Destroy(weightsMesh); } }
public void Clear() { if (cells == null || cells.Count == 0) { return; } CellSignals.MapBeingClearedSignal.OnNext(new UniRx.Unit()); cells.Clear(); foreach (var chunk in chunks) { MapChunkPool.Despawn(chunk); } chunks = null; castChunks = null; if (RiverSurfaceMesh != null) { HexMeshFactory.Destroy(RiverSurfaceMesh); } if (RiverBankMesh != null) { HexMeshFactory.Destroy(RiverBankMesh); } if (RiverDuckMesh != null) { HexMeshFactory.Destroy(RiverDuckMesh); } if (FarmMesh != null) { HexMeshFactory.Destroy(FarmMesh); } RiverSurfaceMesh = null; RiverBankMesh = null; RiverDuckMesh = null; FarmMesh = null; }
private void ClearHexMeshes() { if (standingWater != null) { standingWater.Clear(); HexMeshFactory.Destroy(standingWater); standingWater = null; } if (culture != null) { culture.Clear(); HexMeshFactory.Destroy(culture); culture = null; } if (roads != null) { roads.Clear(); HexMeshFactory.Destroy(roads); roads = null; } if (marshWater != null) { marshWater.Clear(); HexMeshFactory.Destroy(marshWater); marshWater = null; } if (oasisWater != null) { oasisWater.Clear(); HexMeshFactory.Destroy(oasisWater); oasisWater = null; } if (oasisLand != null) { oasisLand.Clear(); HexMeshFactory.Destroy(oasisLand); oasisLand = null; } }