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

Pages: [1] 2
1
I'm in the process of migrating a project from NGUI 3.0.8f2 to 3.6.8, and so far I've only come across one issue.

Setting a widget's Notify to call a method which has overloads, i.e. foo(), foo(int a), will throw an error. In the quoted example below, there are two SetFXVolume methods, one taking an int.

Quote
Could not find method 'SetFXVolume' on SetCurrentValue
UnityEngine.Debug:LogError(Object, Object)
EventDelegate:Cache() (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:388)
EventDelegate:get_isValid() (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:193)
EventDelegate:IsValid(List`1) (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:629)
UIProgressBar:set_value(Single) (at Assets/NGUI/Scripts/Interaction/UIProgressBar.cs:135)
SetCurrentValue:SetFXVolume(Int32) (at Assets//Code/SetCurrentValue.cs:848)
SetCurrentValue:Start() (at Assets//Code/SetCurrentValue.cs:128)


This hasn't been a problem with prior versions of NGUI and I can't see any mention of it in the release notes?

2
NGUI 3 Support / Re: Killing UISlider input
« on: February 25, 2014, 05:09:59 PM »
Yeah the collider disabling is obvious, but it refuses to be disabled, either in code or manually in the inspector. The only difference between my slider and the example sliders is, I have the Background sprite on the same GO as the UISlider component...is that an issue?

The currentTouch code is very useful though, thanks for that.



3
NGUI 3 Support / Re: Killing UISlider input
« on: February 25, 2014, 11:19:17 AM »
Ok so I've have to set some flags to bypass OnValueChange calls.

However the slider is still draggable. It's collider can't be disabled, I expect this is by design, and putting a UISlider.enabled = false on a timer and re-enabling it... it works, but the thing is still dragging if you don't release the mouse when it's re-enabled. FFS.

A similar post:

http://www.tasharen.com/forum/index.php?topic=1062.0

4
NGUI 3 Support / Killing UISlider input
« on: February 25, 2014, 10:56:59 AM »
I've got a UISlider and a pop-up UI.

The pop-up UI appears if a condition isn't met when sliding the slider.

I have a script which toggles collisions in the UI. This works for buttons.

The slider however continues to trigger it's OnValueChange as long as the user keeps the mouse down and drags.

What's the proper way to disable a slider (and other UI Components)? I need the UI to stay visible, so SetActive isn't an option, and setting the UISlider.enabled = false doesn't work either -- continuing to drag seems to just keep it alive.

Perhaps I've a bug in my code, I'm still looking because it's driving me a bit nuts, but am I doing something that isn't NGUI friendly here?


5
NGUI 3 Support / Re: On Value Change triggered when panel is first enabled
« on: February 20, 2014, 09:55:23 AM »
That's fine for that sort of case - and that's the majority of cases I'm sure. I ask this because we have cases where we have to write a lot of init code to ignore UI calls with the way our UI integration is set up - it's simple enough to do, but you start noticing it when you're doing it a lot, and it's probably not the best way of doing things in every case, but for this particular project it's a necessary evil.

No biggy anyway, I understand it's not generally going to be a typical issue, but if it doesn't break anything then a Notify On Active checkbox wouldn't go unappreciated. ; )

6
NGUI 3 Support / Re: Z-pass (non-x-ray) transparency?
« on: February 20, 2014, 09:40:40 AM »
Yeah I figured as much, but it's always worth asking as sometimes someone has a bright new idea - I was thinking perhaps if everything was rendered as a single geometry, but if edges are an issue then that's kind of moot. Hardly my area of expertise anyways..;)


7
NGUI 3 Support / Re: On Value Change triggered when panel is first enabled
« on: February 20, 2014, 09:32:10 AM »
Associated values? Internal to NGUI you mean?






8
NGUI 3 Support / On Value Change triggered when panel is first enabled
« on: February 20, 2014, 09:12:27 AM »
As the subject says, how do we stop UI elements such as UISliders from triggering their Value Change Notify when a panel is first enabled?

9
NGUI 3 Support / Z-pass (non-x-ray) transparency?
« on: February 20, 2014, 04:09:39 AM »
This is a bit off the cuff... I've mentioned it in the voice your opinion thread but it seemed to go unnoticed.

One of the major downsides to NGUI's UI elements is that the alphas of all children to a UI widget (Panel, Widget, Sprite etc) are composited x-ray style when fading Alpha. For example, a slider's BG & FG will show through the thumb when the alpha is < 1, and where elements overlap such a buttons sitting half-on, half-off floating panels or many animating pieces coming together in a complex tween transition.

Is it possible to solve this easily, assuming the elements in question can be batched, or would it need some intrinsic support deep in NGUI's drawing code?

I'm thinking of something akin to Aras's two-pass AlphaVertexLitZ shader.

http://wiki.unity3d.com/index.php?title=AlphaVertexLitZ

10
NGUI 3 Support / Re: Instanced Prefab UIGrid/UILabel elements going crazy
« on: February 14, 2014, 06:01:47 AM »
Ah heck I can't believe I've missed this; guess I've just been plain lucky to date. Thanks for the correction.

11
NGUI 3 Support / Re: Grid anchoring to ScrollView
« on: February 14, 2014, 05:33:48 AM »
Sounds good. Do you have an 3.5 ETA in mind? ;)

12
NGUI 3 Support / Re: Instanced Prefab UIGrid/UILabel elements going crazy
« on: February 14, 2014, 05:19:28 AM »
I'm able to repeat this in an empty project with just NGUI 3.49

Add a UITable and a Sprite to UI Root, place several copies of the sprite in the UITable, run... all works.

Duplicate the Sprites while running via hierarchy and call UITable.Reposition() and it works as expected.

Instantiate the Sprites and attach them to the UITable, and call UITable.Reposition() and the new items are attached with a scale of 384.

Manually setting the localscale to 1, then calling Reposition() is a workaround.

13
NGUI 3 Support / Instanced Prefab UIGrid/UILabel elements going crazy
« on: February 13, 2014, 05:59:07 PM »
When setting up my UIGrid (also trying UITable) in a vertical ScrollView, I've done so with prefabs of the items that will fill it, which are instantiated at runtime, and the instances are re-parented to the Grid/Table.

When I run this, the vertical UIGrid and UITable both exhibit the same behaviour: the instances are way out of position and scale (see attached: "Container -1" is the prefab, "Score Entry 1" is the instance).

I've done this plenty times with a horizontal grid, no problems, and can't see anything different other than these prefabs have a Widget at the top level (I normally use a sprite). I understand widgets with dimensions are fairly new - are they ok to use like this?

edit:
Tested with UISprite prefabs instead of UIWidgets, same result.
Also tested with the UITable outside the ScrollView - it doesn't appear to be UIScrollView related.

Cheers





14
NGUI 3 Support / Re: ScrollView doesn't return to first entry properly
« on: February 13, 2014, 05:39:11 PM »
Yeah, I'm not using UICenterOnChild - we're in a tight crunch period atm but I'll try and get you an isolated example of it asap (this is 3.49 in Unity 4.3.3f1) ; for now I've replaced the UIGrid with a UITable, which doesn't appear to have the same issue.

15
NGUI 3 Support / Re: Grid anchoring to ScrollView
« on: February 12, 2014, 01:49:50 PM »
Sorted the anchoring by attaching an Anchor.

It would save a lot of headaches if this was included in the Attach-> context menu.

Pages: [1] 2