Question by
Shadowblitz16 · May 15, 2020 at 02:04 AM ·
c#editortiles
How to Place currently selected tiles in the editor
is there a way to get the bounds and array of selected tiles currently selected in the unity editor tile palette window? I am making a tilemap wrapper and I would like to place them down in edit mode.
private void OnMouseDown()
{
Vector3 pos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
if (HasLayer(Layer))
{
/* doesn't work
var state = ((GridBrush)(GridPaintingState.gridBrush);
foreach (var c in ).cells)
{
GetLayer(Layer).SetTile(state., c.tile);
}
*/
//Something like this? note these methods don't exist
Tilemap.SetBlockTiles(TilePalette.SelectedBounds, TilePalette.SelectedTiles);
}
}
Comment
Your answer
Follow this Question
Related Questions
Slow unity things 0 Answers
Camera Preview is empty 5 Answers
Make a 3D Object look like hes facing a point in an 2D space 0 Answers
EditorGUILayout.ObjectField and array 0 Answers
Why does UnityAds crash my game after I close the ad? 0 Answers