Ejemplo n.º 1
0
        /// <summary>
        /// Updates tiles to update when the current queue of tiles
        /// has finished generating.
        /// </summary>
        public void Update()
        {
            if (_queueCompletedAction == null)
            {
                _queueCompletedAction = UpdateNeighbors;
            }

            Cache.PurgeDestroyedTiles();

            if (_queuedTiles < 1)
            {
                Config.StartCoroutine(UpdateTiles());
            }

            Config.StartCoroutine(UpdateColliders(0.5f));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Updates tiles to generate when the current queue of tiles
        /// has finished generating.
        /// </summary>
        public void Update()
        {
            //Register event handlers for object placer
            if (_isFirstUpdate)
            {
                TerraConfig.Instance.Placer.RegisterTileEventListeners();
            }

            //Calculate remap
            if (Config.Generator.RemapHeightmap && _isFirstUpdate)
            {
                _isFirstUpdate = false;
                CalculateHeightmapRemap();
            }

            Cache.PurgeDestroyedTiles();

            if (_queuedTiles < 1 && !_isGenerating)
            {
                Config.StartCoroutine(UpdateTiles());
            }
        }