Author Topic: recommended way of dealing with scene object selection?  (Read 4137 times)

Arcanor

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 46
    • View Profile
recommended way of dealing with scene object selection?
« on: March 09, 2014, 09:22:14 AM »
What is the recommended way of dealing with scene object selection?

If I use Unity's OnMouseOver(), OnMouseDown(), etc. then I don't know if there is any way you disable those events when the player is "supposed" to be interacting with a UI panel.

How do I keep my clicks EITHER in my gui panel, OR on scene objects?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: recommended way of dealing with scene object selection?
« Reply #1 on: March 09, 2014, 09:57:37 AM »
You should not be using OnMouse events. You should be using NGUI events -- OnPress(bool isPressed) would be the equivalent.

As long as your camera drawing the objects has a UICamera script attached, all those objects will be capable of receiving those events.

Arcanor

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 46
    • View Profile
Re: recommended way of dealing with scene object selection?
« Reply #2 on: March 09, 2014, 10:04:03 AM »
Thanks, I will try adding UICamera to my main camera as you suggest.  Hadn't really considered that. :)