/// <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); }
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)); }