Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - nicolethenerd

Pages: [1]
1
NGUI 3 Support / Atlases broken after upgrading Unity
« on: January 24, 2014, 12:39:49 PM »
Just upgraded Unity from 4.1.5 to 4.3.3.  Everything looks great except my sprites - they now seem to be all grabbing the next few pixels from the image next to them in the atlas.  New atlases I create in 4.3.3 are fine.  Is there a way to quickly regenerate all my atlases?

2
Sorry, trigger it how?  I have a game world full of clickable objects with OnClick events on them - are you saying I can't use NGUI events for any of them anymore if I want to have a tap/hold behavior on the screen that takes precedence?  That's sort of what I thought, but just want to confirm.

3
Thanks.  Unfortunately, that doesn't really answer my question - the code you have written is what I was already trying to describe above - I guess I wasn't clear.

What I want to know is, is there a way, in the place where you have commented "you do whatever", to make the event "fall through" to any OnClick handlers that may be on a button underneath my giant sprite with the OnPress handler - rather than consuming the event in the OnPress.

(Or whether there's a completely different and better way to accomplish the same effect, without using a giant invisible sprite with an OnPress handler)

Thanks!

4
I want to distinguish between Tap events and Tap and Hold events in a way that the Tap and Hold events take precedence - basically, if the user holds their finger down anywhere on the screen (including on a button, which may have an associated OnClick event), a particular event should fire (and the OnClick handler for that button would be ignored), but if they just tap quickly on a button, the OnClick event should fire.  I am thinking of implementing something like this:

- A giant invisible sprite which fills the screen and has an OnPress Handler
- Various buttons on the screen that have OnClick handlers

When the user taps the screen, the OnPress handler should fire and test if the tap duration is longer than a certain threshold.  If it is, it should do whatever I want it to do when the user Taps and Holds (in this case, display some additional UI elements).  If it is less than the threshold, it is just a Tap, and the event handling should fall through to the OnClick handler of whatever button the user tapped.

Is this possible?  This is sort of the opposite of the question I asked last week, where I wanted the OnClick events to take precedence and catch any taps/clicks that fell through - now, I want to first test whether the user is pressing their finger down and let that take precedence, and only fire the OnClick events in the case of a short tap.

5
NGUI 3 Support / Re: Catch all click events not caught elsewhere
« on: January 09, 2014, 09:53:50 PM »
Wow, did not know that was a thing - that sounds perfect, thank you!

6
NGUI 3 Support / Catch all click events not caught elsewhere
« on: January 09, 2014, 04:50:11 PM »
I have a setup with two UICameras - one for all of my UI elements, and one for all of the stuff in my game world.  There are clickable elements (with box colliders) both on the UI and in the world.  I now want to catch all click events that aren't already caught by something else - I think I probably need to create a box collider that is "behind" everything, but I am not sure how to do this - I can't put it with my other UI elements, because then it will catch events that were intended for clickable items in my game world, since the UI Camera detects events before the other camera - but I'm not sure how to put a box collider behind my entire game world.  Just make a really big invisible sprite, in every scene? Or is there a better way?

(My use case for this, in case you're curious, is that I have a UI element that toggles a blur effect.  I want the user to be able to click anywhere on the screen to unblur it, with the exception of places that already do something else - those should continue to do whatever they normally do when clicked)

Thanks!

7
NGUI 3 Support / Re: triggering animations from non-NGUI camera
« on: November 04, 2013, 11:11:55 AM »
Thanks.  That makes sense.

We still can't figure out why our button wasn't triggering OnPress, though - we have a workaround, which is to create a button through the NGUI wizard - but is there anything else we'd need to do to a game object besides adding a box collider and the UIPlayAnimation script to make it behave like an NGUI button?

8
NGUI 3 Support / Re: triggering animations from non-NGUI camera
« on: November 01, 2013, 05:16:58 PM »
update - looks like this is possible - generating buttons with the Widget wizard and dragging them out so they are not children of a UI Root still works.  This solves our immediate problem, but still haven't figured out what was wrong w/ the buttons we were making from scratch, though - they had Box Colliders and the UIPlayAnimation script - what are we missing here? Thanks!

9
NGUI 3 Support / Re: triggering animations from non-NGUI camera
« on: November 01, 2013, 04:50:02 PM »
I'm working on the project w/ @leathers above - we're still stuck on this, and I'm not sure either of us understand your reply.

We are trying to attach UIPlayAnimation to an object in our game that is not a child of the UI Root (because it is not a part of the UI - touching an in-game object should trigger the appearance of a UI panel).  However, OnClick and OnPress are not firing in UIPlayAnimation.  Does UIPlayAnimation only work when it is attached to children of a UI Root?

Thanks!

(I think the swipe navigation turned out to be an unrelated issue)

Pages: [1]