Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Custom Event System example? (Getting source to Input Modules)

Discussion in 'UGUI & TextMesh Pro' started by quitebuttery, Aug 20, 2014.

  1. quitebuttery

    quitebuttery

    Joined:
    Mar 12, 2011
    Posts:
    327
    Is there any way for Unity to provide the source to TouchInputModule so we can write our own modules? As far as I can tell, we can't access the source to any of input modules.
     
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,221
    Hi,

    we are committed to making the new UI system open source, but things are not quite ready for us to wholesale release the source code. You can find some source that I have posted here: https://gist.github.com/stramit but please don't consider this an official release and some of the files may be from an earlier beta.
     
  3. quitebuttery

    quitebuttery

    Joined:
    Mar 12, 2011
    Posts:
    327
    THANKS for this! I used your code and some of the docs to come up with this input module for my world-space VR cursor.

    http://ralphbarbagallo.com/2014/08/...ursors-for-world-space-canvases-in-unity-4-6/

    https://gist.github.com/flarb/052467190b84657f10d2

    So I add collision boxes to the gui elements I want on my world space canvas. Then I do a trace in my world cursor code and when it his a GUI element I call SetTargetObject in this module. It handles the rest. (I also poll my input manager for a tap, and when that happens I sent a submit event to the currently selected object)
     
    Last edited: Aug 20, 2014
    Studiomaurer and Tim-C like this.