Search Unity

UnityEngine.EventSystems Does Not Exist

Discussion in 'Scripting' started by InsideJC, Nov 21, 2014.

  1. InsideJC

    InsideJC

    Joined:
    Nov 12, 2014
    Posts:
    5
    Hello all,

    I recently started developing under Unity 4.5.5f1 under their free version. I imported the TouchScript library, which works well with our project, but now dealing with the issue with filtering touch between the 2D GUI layout and the TouchScript touch events. I have an idea of how to accomplish this from other forums, but many topics continue to reference UnityEngine.EventSystems and my project just does not seem to have this reference whatsoever.

    Does anyone have any ideas as to why this is? Any help or advice will be greatly appreciated. Thank you

    Here is a screenshot from my local documentation's Scripting API:



    And here is the Scripting API linked to Unity's website:

     
  2. JasonBricco

    JasonBricco

    Joined:
    Jul 15, 2013
    Posts:
    956
    EventSystem was introduced (to the public through open beta) in Unity 4.6, to my knowledge, and can therefore only be used on 4.6 and onwards.
     
  3. InsideJC

    InsideJC

    Joined:
    Nov 12, 2014
    Posts:
    5
    Thank you very much for your reply.

    Would you or anyone else know how to do the equivalent call 'EventSystem.current.IsPointerOverGameObject()' in Unity 4.5.5 ?
     
  4. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    none because the new ui system does not exist in older versions

    what are you trying to do? learn section has tutorials how to interact with objects in old versions

    also this should be posted in scripting section and not general discussion
     
  5. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    There is no reason to use the old version for a new project. Grab 4.6 and it will work out of the box.
     
  6. InsideJC

    InsideJC

    Joined:
    Nov 12, 2014
    Posts:
    5
    I apologize for posting this in the wrong section. I will continue this on the scripting section as you recommend. I have gone through the tutorials as well so I am sure this is still just a learning curve issue for myself

    Edit: I can see this was already moved into the appropriate forum, thank you for doing this I appreciate it.

    To answer your question, I am building our GUI dynamically using Unity's GUI controls (GUI/GUILayout) in code. When the user interacts with our GUI we want to detect this and cancel the TouchScript touch event that will propagate through.

    Currently, I am able to detect when the user interacts with our GUI by collecting all parent or independent rects (GUI.Box, GUI.BeginGroup, GUILayout.BeginArea, etc....) then call 'Contains' for each rect with the corresponding mouse position. This collection gets cleared when 'OnRenderObject' is called so it will always be up to date after all 'OnGUI' calls

    And we are considering this, but since we are doing a proof of concept that could eventually lead to a shipped product we are reluctant to use any beta versions of a product. Especially since Unity themselves recommend against this on their own website:
     
    Last edited: Nov 21, 2014
  7. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    final version of 4.6 will be released next week or one after it if something goes wrong
     
  8. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    It's been through 21 beta releases, and the current version is rc3 (meaning it's basically finished). Unity staff also recommends it on the forum. There isn't much left to go wrong.
     
  9. InsideJC

    InsideJC

    Joined:
    Nov 12, 2014
    Posts:
    5
    Thank you for your replies, this was the one aspect we were tentative on committing too since they did not publicly give a final release date. Knowing this switching to 4.6 seems like a more realistic option in the near future.

    I appreciate everyone's advice for this