Diab1O
1
Hello
I’m doing an extension for Unity editor - for terrains.
-
By clicking the left mouse button on the terrain in the scene - the terrain is selected.
-
If you hold down the left mouse button and hold on the scene - there is a rectangular area(selection box).
Is it possible to remove this action? Block.
Sorry for the error, Google translate.
Diab1O
2
I found it!
using UnityEngine;
using UnityEditor;
using System.Collections;
public class test : EditorWindow
{
public static test window;
static SceneView.OnSceneFunc onSceneGUIFunc;
[MenuItem ("Tools/test")]
public static void ShowWindow()
{
window = EditorWindow.GetWindow<test>(false,"test");
}
void OnEnable()
{
onSceneGUIFunc = this.OnSceneGUI;
SceneView.onSceneGUIDelegate += onSceneGUIFunc;
}
void OnDestroy()
{
SceneView.onSceneGUIDelegate -= onSceneGUIFunc;
}
public void OnSceneGUI(SceneView sceneView)
{
if(Event.current.control)
HandleUtility.AddDefaultControl(GUIUtility.GetControlID(FocusType.Passive));
}
}