Can this be done using editor classes? (Tile setting)

Hi,

I would like to ask to people with experience writing editor scripts if there’s an easy way to do a little escript for tile setting. This is:

  1. Select mesh/prefab in the project
  2. Click in the editor and instantiate this prefab
  3. Settit to the correct location using snap to 1 meter.

Thanks in advance,
HexDump.

  1. is easy (check the Selection class in the Unity Reference)
  2. is easy (check EditorUtility.InstantiatePrefab)
    3a) setting it to the ‘correct’ location can be anything from easy to impossible, depending on what the ‘correct’ location is. If the correct location can be calculated, it will work
    3b) the snapping to 1 meter is easy (use Mathf.Round on your coordinates)

HI!,

1 is not that easy or this is what I understando from docs. Selection class just makes reference to things in the scene not project tab.

Thanks in advance,
HexDUmp.