Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Created March 7, 2024 10:06
Show Gist options
  • Select an option

  • Save unitycoder/72a178da5003b74a850d646b6ffcfbc6 to your computer and use it in GitHub Desktop.

Select an option

Save unitycoder/72a178da5003b74a850d646b6ffcfbc6 to your computer and use it in GitHub Desktop.

Revisions

  1. unitycoder revised this gist Mar 7, 2024. No changes.
  2. unitycoder created this gist Mar 7, 2024.
    9 changes: 9 additions & 0 deletions SelectionBase.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    // https://discussions.unity.com/t/how-to-i-force-the-selection-of-a-parent-when-a-child-is-selected-in-the-editor/36493
    // other manual option is to lock children with L key: https://www.reddit.com/r/Unity3D/comments/129oc5n/scene_view_select_parent_solved_thank_the_maker/

    // attach into root gameobject, to make it always select root instead of children
    using UnityEngine;
    [SelectionBase]
    public class SelectionBase : MonoBehaviour
    {
    }