コード例 #1
0
ファイル: BlockGhost.cs プロジェクト: ManuelJager/ProjectExa
 /// <summary>
 /// Update the block the ghost is representing
 /// </summary>
 /// <param name="block"></param>
 public void ImportBlock(BlueprintBlock block)
 {
     ghostImage.sprite          = block.Template.thumbnail;
     filterTransform.localScale = block.Template.size.ToVector3();
     AnchoredBlueprintBlock     = new AnchoredBlueprintBlock(new Vector2Int(), block);
     AnchoredBlueprintBlock.BlueprintBlock.SetSpriteRendererFlips(ghostImage);
     AnchoredBlueprintBlock.UpdateLocals(gameObject);
 }
コード例 #2
0
        public static IEnumerable <Vector2Int> GetOccupiedTilesByAnchor(BlueprintBlock block, Vector2Int gridAnchor)
        {
            var area = block.Template.size.Rotate(block.Rotation);

            if (block.flippedX)
            {
                area.x = -area.x;
            }
            if (block.flippedY)
            {
                area.y = -area.y;
            }

            return(MathUtils.EnumerateVectors(area, gridAnchor));
        }