x


Override Editor Controls

Hi all, I've been wondering about this for a few days now, and gave up on it after not finding any answers after a fair whack of searching and just used different key controls. Essentially I have a level editor 'editor script' which allows me to grab objects, group grab, move, spawn and locks the object positions to a grid all on a very basic level which has been very useful in saving some time. Now I've been detecting input commands from the user with the Event class, along the lines of:

if( Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.R )

Which works fine, however I would really like to make it so that I can left click to select objects, or place them and press Spacebar to toggle my editor modes.

Unfortunately left click selects a scene object and Spacebar maximises the current windows viewport. What I would to do is override these controls, so that when my custom inspector (which is my level editor script) is active, it does what I define in that script, is there a way to do this?

Unity obviously has this behaviour as if you edit a terrain, your left clicks don't select the terrain or other objects, they paint textures and such. I'm just not sure if it's exposed - would kinda suck for editor scripting if not though surely?

more ▼

asked Aug 23 at 10:05 AM

Digitalos\'s gravatar image

Ian
492 4 7 21

(comments are locked)
10|3000 characters needed characters left
 moderation talk

0 answers:
Be the first one to answer this question!
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x559
x299
x103
x21

Asked: Aug 23 at 10:05 AM

Seen: 703 times

Last Updated: Aug 23 at 10:05 AM

powered by Qato - Enterprise Q&A