- Home /
Remove actions in Scene
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. :)
Do you mean the selection box that appears, so that you can select multiple objects?
Not sure, I just wanted to clarify what you asked in the question.
Answer by Diab1O · Feb 27, 2014 at 10:50 AM
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));
}
}
Your answer
Follow this Question
Related Questions
Larger or smaller terrain chunks? 2 Answers
TerrainData doesn't save lightmap. 0 Answers
How to give a Terrain a material at runtime? 1 Answer
How can I create voxel based terrain ? 2 Answers
Falling Through Terrain No Matter What? 0 Answers