Пример #1
0
        private void HandlePlayerUnitSpawnPointChanged(IntVector2?playerUnitSpawnPoint)
        {
            if (_spawnCoords != null)
            {
                _tileRendererPool.Despawn(_spawnCoords.Value);
            }

            _spawnCoords = playerUnitSpawnPoint;
            if (playerUnitSpawnPoint != null)
            {
                _tileRendererPool.Spawn(playerUnitSpawnPoint.Value, _sprite, "Players");
            }
        }
        private void HandleTileMetadataChanged(IntVector2 tileCoords, uint?sectionConnection)
        {
            if (sectionConnection == null)
            {
                _tileRendererPool.Despawn(tileCoords);
                return;
            }

            if (sectionConnection.Value >= _mapData.Sections.Length)
            {
                _logger.LogError(LoggedFeature.MapEditor,
                                 "Metadata change on SectionConnection out of bounds: {0}",
                                 sectionConnection.Value);
                return;
            }

            string sectionName = _mapData.Sections[sectionConnection.Value].SectionName;

            _tileRendererPool.Spawn(tileCoords, _sprite, sectionName);
        }