Search Unity

Will the new input system work in the editor(non play mode)?

Discussion in 'Input System' started by thelebaron, Nov 7, 2018.

  1. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    857
    So for custom editors right now the current input system doesnt work. I kind of dislike the event system, and am not really educated on why I cant use the current Input system in conjunction with editor scripts, only that I cant. There was some mouse functionality that was giving me fits, wouldve been simple to do with the input system but was tearing my hair out trying to do it with events. I was wondering(and hoping) if the new system will work for the editor as well?
     
  2. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Yup, it does. You can write custom EditorWindows and other code that runs inside them (e.g. all the custom inspector stuff). You can use the Pen API, for example, to create a pressure-sensitive editing interface.

    We still have to put its through its paces fully and there's probably still issues ATM but the basics should be working.
     
    thelebaron likes this.
  3. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    857
    Oh man, this makes me so happy, so many possibilities await! Thanks Rene
     
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    This might have been mentioned elsewhere, but how does this work when there's not frames around?

    IE. if I've got a [MenuItem] function and check
    Keyboard.current.space.wasJustPressed
    , what is "just"? Last Event? Some custom timeout?
     
  5. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    In that case, every Editor update (EditorApplication.update) becomes a "frame". So, the reference point for wasJustPressed (think these should be renamed to wasPressedThisFrame and wasReleasedThisFrame) becomes the previous editor update.
     
    Baste likes this.