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

Pages: [1] 2
1
NGUI 3 Documentation / Re: UIProgressBar
« on: July 18, 2014, 01:06:44 PM »
Regarding Pro-Tip #1...

I can't get this to work, as described...

It does work if the Foreground field is a UISprite, but not when the Foreground field is a UILabel.  I am using the "Unity" style font (used to be called dynamic) rather than NGUI.  Is this why it isn't working or am I missing something?

2
Hi guys,

Sorry for the tardy response.  I have "notify me" set for this thread, but I didn't get the notification.

Also, apologies for a misdiagnosis.  As it turns out, I was using another Unity add-on and I have now verified that was the culprit.  It was coincidence that I saw a spike in GC.Collect calls after updating NGUI.

Thanks to both of you for your quick responses and your great work!

3
NGUI 3 Support / Re: Button with arguments
« on: July 04, 2014, 12:26:20 PM »
There are a couple of options (neither of which give you exactly what you want, but might be of use to you)...

One approach in this thread: http://www.tasharen.com/forum/index.php?topic=10206.msg47892#msg47892

Another is to not pass a parameter at all, but use UIButton.current to identify which button was pressed and then do your branching based on that. 

4
In our game, we're using a pool of NGUI UILabels to display dynamic event based messages to the user.  This was working well, but after upgrading NGUI to 3.6.5, we now get performance hiccup (moment of unresponsiveness) each time messages are displayed.  Connecting the Unity Profiler to an iOS device and recording, I can see that when this happens, there's a GC.Collect spike each time messages are displayed.  Could you elaborate on (or point me to another thread discussing)...

- FIX: Nicki's optimizations.

... as that's the only thing I see that could possibly be related to this issue.

5
Thanks for the information.

6
Sorry, this was my mistake.  NGUIExtensions is my colleague's class.  I was just too tired at the time to notice.  Having said that, we still can't figure out why UICamera.currentCamera is null in an Update method only in iOS. 

7
All iOS devices that I've tested.  This includes...
iPad2 with iOS 6
iPad 2 with iOS 7
iPad Mini Retina with iOS 7
iPhone 5 with iOS 7
iPhone 4s with iOS 7

8
On iOS, I'm getting NullReferenceExceptions when I attempt to do UIButton.GetScreenRect()

It looks like UICamera.currentCamera is null on line 10 of NGUIExtensions.cs

I know I can just check for null, but if you have any suggestions for how I should/could make a real fix, that'd be great.

This does not happen in the Unity Editor.

9
Just noticed this in the 3.6.1 release notes and decided to check it out...
NEW: Added support for TouchScreenKeyboard.hideInput (input caret, selection, etc on mobiles)

On iOS, however, if I have InputType set to Standard; KeyboardType set to HiddenInput and Validation set to None, I get nothing but capitalized characters and the virtual shift key shows itself as pressed.

As a test, I changed Validation to Username.  That did convert all characters into their lowercase, but the shift key continued to show as on.

Is this a bug or is there a way to change this programmatically?

10
NGUI 3 Support / Re: Tween Alpha repeat use problem
« on: May 20, 2014, 11:40:59 PM »
That's it!  I also figured out that I need to set enabled = true as well on the tweener component.  Now working exactly as I wanted.  Thanks!

11
NGUI 3 Support / Tween Alpha repeat use problem
« on: May 20, 2014, 07:13:21 PM »
I've attached a Tween Alpha component to a UIWidget (which contains a UILabel) to fade the label out after a message has been posted the label.  I have (in the Inspector) set the From field to 1 and the To field to 0 and the Play Style to Once. 

When my message event triggers, I activate the UIWidget's GameObject and in the Tweener's OnFinished event, I'm calling another method to deactivate the UIWidget's GameObject.

This all works as expected the first time, but doesn't work in subsequent activations of the UIWidget's GameObject.  I've tried enabling/disabling the GameObject both via GameObject.SetActive and NGUITools.SetActive with the same result.  It appears that the Tween Alpha component is getting set to false when its OnFinished event fires (regardless of my method) and the alpha remains at 0 after the tweener has set it to that value.

Am I doing this wrong?

12
NGUI 3 Support / Re: UIInput bugs in 3.0.8f3
« on: March 11, 2014, 04:42:02 AM »
Yes, this does indeed work.  It doesn't address the command+p issue I described, but that is an Editor only issue that I can live with.  Thanks!

13
NGUI 3 Support / Re: UIInput bugs in 3.0.8f3
« on: March 10, 2014, 04:02:48 PM »
I apologize, it would appear I'm being an idiot today as the code I proposed actually blocks all input.  This does work, however...
  1.                         if (string.IsNullOrEmpty(ime) && !string.IsNullOrEmpty(Input.inputString))
  2.                         {
  3.                                 // Process input ignoring non-printable characters as they are not consistent.
  4.                                 // Windows has them, OSX may not. They get handled inside OnGUI() instead.
  5.                                 string s = Input.inputString;
  6.  
  7.                                 for (int i = 0; i < s.Length; ++i)
  8.                                 {
  9.                                         char ch = s[i];
  10.                                         if (ch >= ' ' && ch != 63232 && ch != 63233 && ch != 63234 && ch != 63235) Insert(ch.ToString());
  11.                                 }
  12.                         }
  13.  

Sorry about that.

14
NGUI 3 Support / Re: UIInput bugs in 3.0.8f3
« on: March 10, 2014, 09:54:14 AM »
I should also clarify, that this also works to solve the problem we've been discussing...
  1.                         if (string.IsNullOrEmpty(ime) && !string.IsNullOrEmpty(Input.inputString))
  2.                         {
  3.                                 // Process input ignoring non-printable characters as they are not consistent.
  4.                                 // Windows has them, OSX may not. They get handled inside OnGUI() instead.
  5.                                 string s = Input.inputString;
  6.                                
  7.                                 for (int i = 0; i < s.Length; ++i)
  8.                                 {
  9.                                         char ch = s[i];
  10.                                         if (ch < ' ') continue;
  11.                                        
  12.                                         // OSX inserts these characters for arrow keys
  13.                                         if (ch == 63232) continue;
  14.                                         if (ch == 63233) continue;
  15.                                         if (ch == 63234) continue;
  16.                                         if (ch == 63235) continue;
  17.                                        
  18.                                         Insert(ch.ToString());
  19.                                 }
  20.                         }
  21.  

... but there is another problem that is only an issue in the editor that the first solution (from my previous post) also addresses.  That issue is that you can use Command+p on the keyboard to play and stop in the editor.  If you are in play mode in the editor while an NGUI UIInput field has focus, the 'p' part of Command+p is inserted into the field.

15
NGUI 3 Support / Re: UIInput bugs in 3.0.8f3
« on: March 10, 2014, 09:44:53 AM »
That doesn't work, but this does...

  1.                         if (string.IsNullOrEmpty(ime) && !string.IsNullOrEmpty(Input.inputString))
  2.                         {
  3.                                 // Process input ignoring non-printable characters as they are not consistent.
  4.                                 // Windows has them, OSX may not. They get handled inside OnGUI() instead.
  5.                                 string s = Input.inputString;
  6.  
  7.                                 for (int i = 0; i < s.Length; ++i)
  8.                                 {
  9.                                         char ch = s[i];
  10.                                         if (ch >= ' ' && ch < 63232 && ch > 63235) Insert(ch.ToString());
  11.                                 }
  12.                         }
  13.  

Pages: [1] 2