Search Unity

There is a way to make an object easily clickable on scene (Editor)?

Discussion in 'Scripting' started by RogerioJuniorClassplash, Apr 9, 2021.

  1. RogerioJuniorClassplash

    RogerioJuniorClassplash

    Joined:
    Sep 4, 2019
    Posts:
    2
    Hello, I remember seeing somewhere how to make a object have "priority" when clicking in the "Scene" while in editor.

    When I want to click a UI element inside Layout for example, sometimes I need to click like 10 times. There is a way, right?

    Thanks in advance :D
     
  2. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,066
    You can use the [SelectionBase] attribute, which will make it behave like prefabs, with the first click selecting the base object.

    You can also add some gizmo using MonoBehaviour.OnDrawGizmos and then clicking the gizmo will select the object it belongs to.
     
  3. RogerioJuniorClassplash

    RogerioJuniorClassplash

    Joined:
    Sep 4, 2019
    Posts:
    2
    That was it, thanks!