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);
            }
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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;
            }
        }