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

Pages: [1]
1
I'm not sure either, since I already revert to using 3.8.0 so I can't really test.
But last time I tested, NGUI only accept joystick button0 as input, whatever joystick button I put as submitKey1 or submitKey2. Whatever I put in UICamera inspector is ignored.
And scheme changing problem (the 1st, combined by 2nd code lines I posted before) also ignore submitKey1 & submitKey2 if I put keyboard button in them.

The way to replicate them is easy, make UI, set enabled scheme to controller only (or controller & keyboard, I don't think these options even used anymore), disabling touch and mouse, set submitKey1 to Z, submitKey2 to joystick button1; or, whatever input that is 'not' return and joystick button0. Try using those buttons.
In my case (new empty project, only has NGUI 3.9.0b, new scene with 2 button and UIKeyNavigation), those submit buttons don't work. But, if you try pressing joystick button0, the onClick triggered. This is why I think your input procedsing is hardcoded to joystick button0.

2
in UICamera
  1. static public ControlScheme currentScheme
  2.         {
  3.                 get
  4.                 {
  5.                         if (mCurrentKey == KeyCode.None) return ControlScheme.Touch;
  6.                         if (mCurrentKey >= KeyCode.JoystickButton0) return ControlScheme.Controller;
  7.                         return ControlScheme.Mouse;
  8.                 }
  9.                 set
  10.                 {
  11.                         if (value == ControlScheme.Mouse)
  12.                         {
  13.                                 currentKey = KeyCode.Mouse0;
  14.                         }
  15.                         else if (value == ControlScheme.Controller)
  16.                         {
  17.                                 currentKey = KeyCode.JoystickButton0;
  18.                         }
  19.                         else if (value == ControlScheme.Touch)
  20.                         {
  21.                                 currentKey = KeyCode.None;
  22.                         }
  23.                         else currentKey = KeyCode.Alpha0;
  24.                 }
  25.         }
  26.  
those lines changes the current key to KeyCode.JoystickButton0; which disregading the submitKey1 that I set to JoystickButton1, while making pressing the keyboard (which I set submitKey0 to 'Z' button on keyboard) change the scheme to Mouse, which would make these lines
  1. if ((submitKeyDown || submitKeyUp) && currentScheme == ControlScheme.Controller)
  2.                 {
  3.                         currentTouch.current = controllerNavigationObject;
  4.                         ProcessTouch(submitKeyDown, submitKeyUp);
  5.                         currentTouch.last = currentTouch.current;
  6.                 }
  7.  
Won't be processed since the scheme is Mouse

This is just my conjecture, so forgive me if those lines don't actually do something like I thought it would. I still can't use 3.9.0b the right way, it just won't do things that worked on 3.8.0.
Another example: 3.8.0 use Select/Deselect as the triggered event when a widget is selected from controller (I'm using UIEventTrigger component), whereas 3.9.0b use HoverOver/HoverOut. Switching to hover is not a big problem, but sometimes the HoverOut didn't trigger, making some function that was supposed to be called, not called.

3
For 'clicking' anything on NGUI. I can't even click anything now.
I see in your UICamera that you hardcoded it to joystick button 0, which isn't what I want, since different gamepad have different button scheme, and also I use custom input so player can customize their own buttons.
In the previous version I use (3.8.0) I can do this easily by changing the submit0 & submit1 keycode to the keycode I want. I can't now.
Also the new context switching becomes a problem if I want to make a console-like games, use keyboard & controller only without mouse, since now, enabling keyboard also enabling mouse, which intervenes with the events (mouse accidentally hovers, etc)

4
I had set the submit 1 to Z, for debugging using keyboard, and submit 2 to Joystick Button 1 (red B on XBox controller, wanted to do japanese style input), and I'm gonna change those submit button based on user input.
Somehow after upgrading none of these buttons work. UIButton widget, UIEventTrigger, none of them OnClick worked.

5
NGUI 3 Support / BMFont's Outline
« on: May 26, 2015, 06:37:02 AM »
How to use BMFont's outline to work with UILabel?
I've set the outline thickness on BMFont, export it with glyph one one one, or glyph outline outline outline, but there's no change on UILabel's visual after switching the font, it's like the outline parameter on the font is downright ignored.
When I tried using 'encoded glyph & outline' as alpha channel, the result is just having a blurry grey outline.

6
NGUI 3 Support / Using 'Cancel' key
« on: March 04, 2015, 06:34:47 AM »
How do I use it?
As far as I know, Submit is tied to 'On Click' in Event Trigger and 'Select on Click' on UIKeyNavigation. But there is no trigger for 'Cancel'.
Example: If I'm on save menu then I want to quit, I press the 'Cancel' button, then a confirmation pop up appears "Do you want to continue without saving?" and 2 button Yes/No. How do I achieve this?

*If this was 'Submit' button, I can just use the 'confirmation pop up' panel as target for 'Select on Click' on UIKeyNavigation, add Event Trigger on that panel to show itself, then be done with it.

7
I see, I'll just wait for the next update then.

*about the link: in 3.8.0, all of those (UICamera.currentTouchID < -1) already changed to (UICamera.currentTouchID < -1 && UICamera.currentScheme != UICamera.ControlScheme.Controller), so the problem is not there.

8
NGUI 3 Support / Re: UIKeyNavigation's Start Selected don't do onSelect
« on: February 25, 2015, 07:44:27 AM »
Sorry Aren, it still don't work even after replacing. And yeah, I have the Pro version since I download it directly from asset store.

9
NGUI 3 Support / UIKeyNavigation's Start Selected don't do onSelect
« on: February 23, 2015, 05:50:15 AM »
I'm using Unity 4.6.0 and NGUI 3.8.0 (documentation said 3.7.7)
When I was watching the tutorial, Start Selected supposed to play the animations, usually hover and such right after the scene started. (Or in Controller Input example, plays the button animation through UIPlayTween).
It doesn't happen, both in my newly made scene, or in the Controller Input Example. The object is selected, yes, but the animation (or any onselect event) didn't trigger.
EDIT: after checking, only the OnHover color / set sprite of the button that didn't trigger, it's fine if I use PlayTween or PlayAnimation.

any way to fix this?

The UIKeyNavigation itself works fine, if I navigate to other buttons, the hover animation plays as intended. It just the initial onSelect that is not triggered.

Pages: [1]