Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to temporary disable all events for other objects?

Discussion in 'UGUI & TextMesh Pro' started by The-Oddler, Sep 13, 2014.

  1. The-Oddler

    The-Oddler

    Joined:
    Nov 26, 2010
    Posts:
    133
    I have an object that implements BeginDrag, Drag and EndDrag to so I can drag it around. But when I drag it over an other button, I can see the button light up, to indicate the mouse is hovering over it. Now it could be problematic that other objects still get events while I'm dragging this objects. Is it possible to disable all events for other objects?

    Thanks!
     
  2. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
    Event.Use();
     
  3. The-Oddler

    The-Oddler

    Joined:
    Nov 26, 2010
    Posts:
    133
    Yes I did that one. But that seems the only stop the current event. I could perhaps implement all events in my script and do that for every single one, but that seems like a stupid way of doing it, doesn't it?