public EBlockTextureId GetTexture(BlockShapeData shapeData)
        {
            if (!_textures.TryGetValue(shapeData.ShapeType, out var textureId))
            {
                UnityEngine.Debug.LogError($"{this}: texture id for '{shapeData.ShapeType}' was not found.");
            }

            return(textureId);
        }
Esempio n. 2
0
        public IEnumerable <Vector3Int> IterateBlockSections(Vector3Int position, Quaternion rotation, BlockShapeData shapeData)
        {
            var center = _levelTransform.TransformPosition(position);

            foreach (var seg in shapeData.Sections)
            {
                var pos = center + rotation * seg;
                yield return(_levelTransform.InverseTransformPosition(pos));
            }
        }