Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

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:
    329
    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,225
    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:
    329
    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.