Search Unity

  1. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  2. Unity 2017.1 is now released.
    Dismiss Notice
  3. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  4. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  5. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice

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

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

  1. quitebuttery

    quitebuttery

    Joined:
    Mar 12, 2011
    Posts:
    269
    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:
    1,911
    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:
    269
    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.