Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. We're excited to be bringing you the newest Unity features, news, demos, and we've even got some special guests from some of the industry’s most storied franchises. Set a reminder to tune in on YouTube here
    Dismiss Notice
  3. Unity 2018.3 is now released.
    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:
    152
    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:
    152
    I found that
    Code (CSharp):
    1. int id = GUIUtility.GetControlID(FocusType.Passive);
    2. HandleUtility.AddDefaultControl(id);
    3.  
    is working solution.