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 - oxyscythe

Pages: [1]
1
So I've gone ahead and implemented this (and even tried various ways to make it a bit more data driven by having a single "AnimatedProperty" component and exposing a list of string properties that the user can define, then fetching those properties on the component and animating them on the update)

Which is all well and good.

However!

Initially it looked like this wasn't working. I would scrub the timeline and play the animation and it would have no effect.

When I ran the game though I realised that actually, it is working, however it's not working in the editor.

Any idea why that might be? I would have thought that the property still gets set as normal in the editor from changes in the animation (it is definitely changing in the inspector), so why would it not update the scene view/

Any further suggestions on what I could do? As, it's all well and good that this technique is working when the game is running, but if you can't see what you're doing when you're animating, then it's all a bit moot really.

Thanks!

2
Oh ok, that's very interesting! As it seems that as the animation has been getting more complicated, the MAlpha workaround doesn't seem to be doing the trick anymore! Basically different "layers" of the animation will randomly appear or disappear (usually based on whether they were recently selected in the inspector, which I guess causes things to redraw)

So you're saying color changes don't guarantee an update either then...

Interesting...right, might have to try your approach then...oh well

3
Thanks ArenMook, you're right, upon further investigation I realised that this is indeed an obvious issue with the fact that properties don't get exposed in the editor (I was seeing MFillAmount, thinking it was the public property, whereas it is indeed the private one which has just been tagged as Serializable and therefore appears in the Inspector)

So yeah, since I am effectively setting the private member directly, the setter doesn't get called when I am playing the animation, so the geometry doesn't get dirtied so then the animation doesn't appear to be updating.

Whilst investigating I actually stumbled on a workaround whilst investigating which is, if I set keyframes for MColor to run alongside the MFillAmount animation (even if it's something as subtle as keying alpha from 0.99 to 1), then the animation updates properly (presumably Color changes force a full update?)

So I am now trying to decide whether I should go for that or for your approach (which I am a bit hesitant about as I am not too keen on peppering everything with this dummy component just to facilitate animation of a property). Both approaches feel a bit hacky anyway (not sure it's any better to have redundant alpha keyframes). Ideally Unity would just expose public properties in the editor! How cool would that be?

4
I've been trying to animate the FilledAmount property of some filled sprites and I've been getting an issue where, when I'd scrub the animation timeline or just play the animation, I wouldn't see the changes on the sprite. Until I clicked on some other editor panel, which would (presumably) the sprite to refresh and *then* I'd see the sprite look like what I'd expect to see at that point in the animation.

I thought maybe it's just an editor only problem so I ran the game but alas, it's still broken in the game (basically the animation would appear as if frozen at some random point at the beginning of the animation)

Any thoughts? Maybe the FilledAmount changes don't cause a regeneration of the sprite mesh?

I have a tiny test project that illustrates the issue, which I set up to make sure it's not something in our code that causes the issue so I can share that if needed

5
NGUI 3 Support / Re: Radial Reveal guidance?
« on: July 23, 2014, 01:12:57 PM »
Yeah I kinda need both as we need the size independent behaviour of Spliced as well as the Radial/Horizontal/Vertical Fill behaviour of the Filled.

Thanks for the OnFilled suggestion, I will look into that when I get the chance and hopefully do it that way, for now I have gone with a different, simpler effect (much to the dismay of the art team! ;) )

6
NGUI 3 Support / Re: Radial Reveal guidance?
« on: July 22, 2014, 06:08:02 PM »
Spent most of the day looking into options for this but came up blank :(

Bit frustrating as both the FilledSprite and the SplicedSprite functionality is there, I just need to be able to have them both.

Workarounds like trying to apply some sort of mask and applying the mask to my frame sprite didn't seem to work (as there doesn't seem to be any masking support - closest I found was using a clipping panel, but clipping is based on a rect so you can't do radial stuff like the FilledSprite)

So the best (only) option right now seems to be to add code to the UISprite so that additionally to the other types, it can also handle a SplicedFIlled type.

This too seems to get rather convoluted as the filling code in UISprite seems fairly complex and specialised to the current use cases that are handled.

I did spot the Advanced type too but again you can't seem to be able to have a radial type for the subtypes of the advanced type.

Failing all that are there any other suggestions on how to do this? Thanks!

7
NGUI 3 Support / Re: Radial Reveal guidance?
« on: July 22, 2014, 04:43:38 AM »
Aha! Yes, this is perfect, exactly the kind of thing I was looking for! Thanks!

That said, I have a slight follow up issue.

The sprites I need to do this on kinda need to be sliced sprites as they are buttons that may vary in size, and I need to do the radial reveal effect on the border (the animation goes something like ->radial reveal border->scale and alpha in button fill->pop in button text)

Any suggestions on how to go about doing that?

Thanks!

8
NGUI 3 Support / Radial Reveal guidance?
« on: July 21, 2014, 10:27:03 AM »
Hello! I am needing to do a radial reveal effect on a button and I was going to go down the custom shader route, but as I was doing some research I noticed the poster of this post here:

http://forum.unity3d.com/threads/health-bar-reveal-shader-with-1-drawcall-1-texture.125843/

was saying that actually NGUI might be able to do this already out of the box?

Is that indeed the case and if so could you point me to some resources that explain the process?

Many thanks!

9
Indeed, must be some version incompatibility thing as I replaced the old Simple Buttons with new Simple Buttons from the latest version and the problem seems to go away.

I am having a new (smaller) problem now though which is, the new buttons don't seem to respect the fact that the UIButton component is disabled on the gameobject at startup?

Basically I have these buttons hidden (UIButton disabled in the editor) and they become enabled at some point through script. The previous buttons worked fine in this regard, now when I disable the UIButton component in the editor the button is still visible. This is actually the case in the editor too, toggling UIButton does not hide the button sprite (before it did). I thought maybe the rendering of the button has been decoupled from the UIButton component in this last version, but then actually when I keep toggling their state when the game is running, they do disappeared on subsequent runs of the script that disables the UIButton component. It seems to be only during startup that this isn't respected. Like the editor setting does not persist during startup. Is this possible?

10
NGUI 3 Support / Re: Checbkox usage confusion
« on: July 19, 2014, 06:14:09 PM »
Hi, sorry for taking a while to get back, I ended up using the UIButton component of the widget and handling the OnClick instead which worked out as a workaround and then I forgot to check back on this thread.

So what's really weird is that I just changed the code back to what it was (so, I am using the UIToggle component and the onChanged event), but now it all works fine! current is indeed null when I step through this code and the delegate is fired properly.

I am sorry, I am not sure what I was doing before to have caused the other behaviour, but I guess all's well that ends well?! I will let you know if I see it happen again!

11
Ooh...good question. I am not quite sure I am afraid. I hadn't done an upgrade in a long time. Looking at the old package modification date it dates back to Dec 2013 if that gives you any ideas. Also I previously didn't have the prefab toolbar at all. I spawned these buttons using the Simple Button prefab from the NGUI folder and then just changed the sprite so nothing really special.

It's not a big deal, I will just recreate them from scratch using the new prefabs. Just curious as to why this might have happened more than anything.

12
NGUI 3 Support / Checbkox usage confusion
« on: July 16, 2014, 05:00:58 PM »
Hello!

I am trying to understand how I am meant to use the checkbox script.

I've got a "UIInteractionManager" script that's meant to handle events from my UI elements and it exposes some public fields so I can attach relevant widgets to that script in the editor.

So I've got a checkbox control that I am passing to this script in this manner and then in Start() I do this:

        DebugOptionsCheckbox.onChange.Add(new EventDelegate(HandleDebugOptionsCheckboxOnChange));

However my handler doesn't get called when I click on the checkbox.

Debugging the NGUI code I noticed that the code that fires the event (UIToggle.cs line 232) is never called because the check on line 226 (current == null) returns false (I am not copy pasting the code as I am not sure if it's allowed but hopefully this is enough information)

Why is this event not fired? Am I using the control in a way that's not meant to be used?

Thanks!

13
NGUI 3 Support / Buttons fading out after upgrade to latest version
« on: July 15, 2014, 06:19:24 PM »
Hello! First post so apologies for potentially newbish question!

I just upgraded to the latest version and I am having a weird issue where a bunch of buttons in my scene are fading out completely (become invisible) after I hover away from them. So more specifically, the buttons show up, then I hover on them and they do their colour tweening, then I hover out and they disappear.

There's nothing really special about these buttons either, I had created them using the "Simple Button" prefab from a previous version of NGUI and just changed the sprite to use a sprite of my choosing. Just to reiterate too: these were working fine, it's only after grabbing the latest version that I started experiencing this

Thanks in advance! (and also, since it's my first post, thanks for NGUI itself, it's a great piece of software!)

Pages: [1]