In other programs like Photoshop, After Effects, 3dsmax, Maya you can lock objects or layers so you don’t select them by error when working in the viewport. I want to lock my background in my 2D game.
I have tried a temporal solution to turn off the Mesh renderer from the object. (but is not exactly a lock from selection since I can’t view it anymore).
There is a way to make a single object unselectable in Unity 2019.3 and newer. There is a hand icon to the left of an object in the hierarchy window. Clicking it toggles between blocking and allowing to select the object on the scene. More info at the following link, in the “Setting GameObject visibility and pickability section”: https://docs.unity3d.com/Manual/Hierarchy.html
It’s been a long time since the question has been asked. Just in case someone is still interested, there is a way to make object unselectable via click in scene. Simply add a pass with tag "LightMode" = "Picking" in your shader and discard its result instead of returning the correct _SelectionID. This is how Unity picks objects on screen fast.
There is no built-in way to do this in Unity (or at least I’m not aware of it!) but you could always script it quite easily. Here is a link to another question that pretty much solve the same thing : Lock Object Position In Editor - Unity Answers
To answer my own question: I found an utility in the Unity Asset Store that does exactly what I want. You can lock objects so you can’t edit them and also configure it in the preferences so you can’t select them in the viewport. Also is free so anyone can use it. (I’m not affiliated or know the person that made the plugin).