Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: dogfacedesign on February 05, 2016, 03:33:55 PM
-
This has been covered before, many times here (and other places), but I can't seem to get over the hump with it. I must be missing something.
I have a panel with a horizontal slide control on it. Sliding the control results in the underlying world pan being panned left and right lol. So obviously, the events are falling through. As far as I can tell, my cameras are set up properly. Main camera handles its thing, and the UI Root/Camera handles the UI - masks look ok to me. I've tried manually adding colliders behind my panel, but no love. Anyone have any suggestions?
If I can't solve this problem tonight, I swear I will kill this kitten! ;D
Cheers.
-
Sounds like you are doing your own Input checks in your game instead of using NGUI events.
You need to stick to NGUI events. Instead of checking input, try subscribing to UICamera.onDrag and other delegates. Inside check what you are dragging and/or UICamera.isOverUI, and only then pan your world.
-
Hey Arenmook - thanks for the response, mate.
Unfortunately, in this case, I am using another package which provides that functionality underneath. I may need to try to figure out a workaround or something. I'll dig into it some more.
Cheers.
-
Just a quick update for anyone following this thread. Still struggling with the issue, and the more progress I make on the game, the bigger the problem is for me. As an example, I have an interactive minimap that is provided by the same underlying package. I have no problem getting it to "show up" - but I can't interact with it. Unfortunately, all of the interaction with the minimap is pretty much handled in a private class which I can't target with a UIEventTrigger.
So here's the thing. I need to basically figure out a way - an easy way, given the size of this project lol - to basically have NGUI handle the scripts that have NGUI handlers for things like OnClick, etc. And let the other stuff just fall through to the Update() method of this underlying package.
I tried creating a little "conduit" of sorts, using UIEventListener. It sort of worked - well, I was able to add a little method in the private class to basically act as a UICamera.genericEventHandler for things. My method was called when the events happened, but unfortunately, the event is already eaten by NGUI, so I can't just simply call his method which handles all the user interaction. I know that I have the gameobject, and obviously the event name (OnClick, etc.), but if I were to rely on those two pieces of information, I would end up having to hack the crap out of his class, which sort of defeats the purpose lol.
At any rate, thanks for listening .... I'm still open to any ideas out there. Again, I'm still on the early part of the learning curve with C#, Unity and NGUI - love all three! But at this rate, I may not have any hair left by this time tomorrow lol.
Cheers.
-
Actually, I think I've decided to help the author of the package provide NGUI support out of the box by splitting up his input handlers into proper NGUI methods and having that as an optional helper script in his package. So it might have a happy ending for everyone :D
Cheers.