Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

How to disable selection other objects in scene view, (like edit-mode in LightProbeGroup inspector)

Discussion in 'Extensions & OnGUI' started by Kichang-Kim, Dec 21, 2018.

  1. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    119
    Hi. I'm trying to implement my own point-editable inspector, like Unity's LightProbeGroupInspector.

    I found that LightProbeGroupInstpector.cs, PointEditor.cs and so on in UnityCsReference. It provide many usefule information for implementing this.

    But I can't found how to prevent selecting other object when I editing points.

    In edit mode of LightProbeGroupInspector, mouse click of scene view only allows selecting the point of light probe, and clicking on other object is safely ignored.

    How to implment this behaviour?

    Thanks.
     
  2. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    119
    I found that
    Code (CSharp):
    1. int id = GUIUtility.GetControlID(FocusType.Passive);
    2. HandleUtility.AddDefaultControl(id);
    3.  
    is working solution.