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

Pages: [1]
1
NGUI 3 Support / Ignore controller
« on: February 22, 2016, 04:36:19 PM »
Guys, i´m trying to ignore joystick from script. At run time, I tryed to set uicamera to ignore joystick inputs without success.
How i would do that:

UICamera.ignoreControllerInput = true;

or

UICamera.current.useController = false;

or

UICamera.disableController = true

or what?


thanks

2
NGUI 3 Support / Re: Avoid Click same time
« on: January 12, 2016, 05:15:39 PM »
ArenMook thanks for your time and effort.

Yes, would be very good. I understood the first time you brought it up. Thank you!

3
NGUI 3 Support / Re: Avoid Click same time
« on: January 11, 2016, 08:08:50 AM »
ArenMook, thanks for the reply.

i understand the concern about not put game things on ui system, but, on my project i don't play tweens, i only play UIPlay Tween, because theres is a lot of tweeners being playing behind it, not only two or three. My game screens are complex and multiple objects are animated at same time. So i dont tryed to control each tweener, even for put each one in a custom list.

So, I  needed to change uiplaytween, so uiplaytween controls the custom list. Because all the tweeners will be children of it.  :o

4
NGUI 3 Support / Re: Avoid Click same time
« on: January 07, 2016, 03:23:25 PM »
Thanks for the reply. it can be easily made.

On my project, to bypass the tweens I don´t care I made UIPlaytween class generate the list of tweens of same group. Also, on each tween, UIPlaytween register a method on OnFinished to remove it from that list.
The list is static, so i can look into it and make my decisions about other tweens.

Could be possible NGUI maintain a static list of teens playing and a property read only?

Something like this:

    static List<UITweener> UITweeners;

    public static void AddUITweener(UITweener tweener)
    {
        if (UITweeners == null )
            UITweeners = new List<UITweener>();

        UITweeners.Add(tweener);
    }

    public static void RemoveUITweener(UITweener tweener)
    {
        if (UITweeners == null)
            return;

        UITweeners.Remove(tweener);
    }

    public static bool IsAnimating()
    {
        if (UITweeners != null && UITweeners.Count > 0)
            return true;

        return false;
    }



5
NGUI 3 Support / Re: Avoid Click same time
« on: January 07, 2016, 12:57:48 PM »
Yes, thanks ArenMook.

But, would be cool if we could know if any tweener is playing.

I can do a findcomponent in scene and ask if any tweener is enabled. but it cost a lot.

In my solution here I create a list of all tweener playing. When each one stop, they leave the list.

If the list is greater then zero, a tweener still playing, and I do not accept inputs from any button.

My solution is bizarre, i know. Cuz, first, was needed to change NGUI to do that. Second, mantaining this list here cost more memory and more time of the frame.

Would be better if UITweener class had a static list, where each one tweener started add it self in. And, internally, remove it self from when finished.
This list, or a property knowing this list, would be accessed statically from every where. So, you can know now if any tweener is playing.


6
NGUI 3 Support / Re: Avoid Click same time
« on: January 05, 2016, 03:12:58 PM »
Friend, you could do this by many ways. I can tell you the way i did.

Any button pressed verify if some tweener is playing.

void ButtonPressed()
{
   if (any)
      return;
   else
      Do();
}


I can´t tell you the best way to know if any tweener is playing, my solution is not elegant, so i will not show you for now.
I sought for some static method or property in NGUI, but I do not found.
Perhaps somebody can show us how to do this. Anybody?  ::)

7
Well Guys, i am now on that days....this line of code simply does note work:

UICamera.controllerNavigationObject = go;
UICamera.selectedObject = go;

The case here is, i have this pop-up dialog screen above all other screen.
Before this happen, navigationobject (as selectedobject) was a "play button".
So, pop up shows and would switch navigationobject (and selectedobject) to "ok button".
But is not working. I dont know if ngui is taking your decisions here and changing the reference I already set.

I am trying to wait a frame using coroutines. But it works 50% of the time.

 I´m in trouble here. Sure I am not understanding half this the scenarios. But, seriously, I think ngui must to solve better stuff like this.

8
Thank you guys!
I will try some changes following your steps.
I will keep you informed.

9
Hi Guys!

I´m working on a project using joystick plus mouse/keyboard on screens navigations. I know NGUI is not designed to word simultaneously with this devices, but:
Our screens have a lot of transitions, screens overlaping each other, animations, and button states (over, pressed). And, need to work simultaneously with both devices (joystick + mouse/keyboard).

Do this thing have been very tricky.

My problem number 1:
Some times simply set programmatically the hoveredObject and controllerNavigationObject does not work, and ngui loses focus. So, i have been trying to wait a frame or wait tweens until it finishes, to set the focus of the navigation on screen. Sometimes i even set selectedobject to be sure it works.

My problem number 2:
Obviously, before all of this, sometimes ngui loses focus.
On update 3.9.0 i remember of this:
- NEW: NGUI now automatically finds and focuses on an appropriate UIKeyNavigation object if none has focus while receiving controller-based input.
I think this "automatically way of find and focuses" can be disturbing my "precise control of focus".

So, i ask:
There is a best practice for work on hoveredObject and controllerNavigationObject on NGUI?
I´m trying to precisely control focus between screens on my project. Is that right?
What i´m doing wrong when a set controllerNavigationObject  and hoveredObject?

Some times i try to save localy the reference of UICamera.controllerNavigationObject. So, when I come back to the last screen, I set it back and keep my navigation on. But, half the time the reference is not exactly what i was expecting. And navigation breaks. I know UICamera has your own update and inside a frame is a lot of things happening. Is that the right way to do this or i need to not trust on UICamera state? (or) Is a better approach make each screen save your proper focus independently?

Thank you in advenced.

Pages: [1]