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

Pages: [1]
1
NGUI 3 Support / Re: How to avoid the cost by the Update() in UIRect
« on: December 12, 2014, 08:45:14 AM »
From what I'm seeing in the code there are only some flag checks and editor checks that are performed in order to determine if a UIRect.Update has any work to do. These are if the anchor is set to Update(), if the editor not in play mode, if the sprite/texture is set to fixed aspect, if the sprite is animating or if the sprite was changed. Most of these checks can be boiled down to a simple flag that is set on the widget to tell the panel that it needs to be re-evaluted for receiving the Update(). Then in the Panel's UpdateWidgets() it could re-evaluate the widget's update need and manage the list there for the widgets that need them. I could be wrong as well. Regardless, it's only a suggestion for Aren or whomever to consider.

Thank you for your suggestion.  I had no  good idea before so I came here for help. I will take you advice into account. Thank you again.

2
NGUI 3 Support / Re: How to avoid the cost by the Update() in UIRect
« on: December 12, 2014, 08:37:01 AM »
Thank you very much .

I wish that the UIRect.Update() methods are executed only when they need. Also I wish NGUI will become a stronger and faster UI system.

3
NGUI 3 Support / Re: How to avoid the cost by the Update() in UIRect
« on: December 09, 2014, 07:39:32 AM »
Thank you first !
I use the Unity-->Profiler to debug the cost of the Update() method.
I rarely used Update() method in my codes. For example, when i worked with the pack, there would be hundreds of ItemIcons in the pack. The ItemIcon was made up of the UIWidgets, and there is no Update() method in it. When i ran the pack view, the performace is very bad. I debug in the Profiler window, i saw that the UIRect.Update() cost a lot.

4
NGUI 3 Support / Re: How to avoid the cost by the Update() in UIRect
« on: December 08, 2014, 09:35:03 PM »
I did an experiment on mobile phone before. execute an empty Update() method would cost 0.005ms~0.007ms (60FPS). If 100 UIWidget, 100 empty Update() method would cost 0.5ms.
But Update() is the method in UIRect, I can't stop it. Could you tell how to solve this problem in another way ?

5
NGUI 3 Support / How to avoid the cost by the Update() in UIRect
« on: December 08, 2014, 09:26:25 PM »
Hello guys, as we all know that the Update() method would cost some of the performance. If only one, that is not a problem, it costs only a little; but if 100 UIWidget, they will cost a lot.
How to avoid the cost by the Update() in UIRect.

6
NGUI 3 Support / Re: UIDragObject Problems in NGUI 3.7.2
« on: September 23, 2014, 09:45:16 PM »
Change UIPanel's ConstrainTargetToBounds() function on line 1704 to this:
  1.         public bool ConstrainTargetToBounds (Transform target, ref Bounds targetBounds, bool immediate)
  2.         {
  3.                 Vector3 min = targetBounds.min;
  4.                 Vector3 max = targetBounds.max;
  5.  
  6.                 float ps = 1f;
  7.  
  8.                 if (mClipping == UIDrawCall.Clipping.None)
  9.                 {
  10.                         UIRoot rt = root;
  11.                         if (rt != null) ps = rt.pixelSizeAdjustment;
  12.                 }
  13.  
  14.                 if (ps != 1f)
  15.                 {
  16.                         min /= ps;
  17.                         max /= ps;
  18.                 }
  19.  
  20.                 Vector3 offset = CalculateConstrainOffset(min, max) * ps;
  21.  
  22.                 if (offset.sqrMagnitude > 0f)
  23.                 {
  24.                         if (immediate)
  25.                         {
  26.                                 target.localPosition += offset;
  27.                                 targetBounds.center += offset;
  28.                                 SpringPosition sp = target.GetComponent<SpringPosition>();
  29.                                 if (sp != null) sp.enabled = false;
  30.                         }
  31.                         else
  32.                         {
  33.                                 SpringPosition sp = SpringPosition.Begin(target.gameObject, target.localPosition + offset, 13f);
  34.                                 sp.ignoreTimeScale = true;
  35.                                 sp.worldSpace = false;
  36.                         }
  37.                         return true;
  38.                 }
  39.                 return false;
  40.         }

Perfect !!! You are so cool ! Thank you very much !

7
NGUI 3 Support / Re: UIDragObject Problems in NGUI 3.7.2
« on: September 23, 2014, 01:05:54 AM »
What is your UIRoot's configuration?


Thank you first !

my UIRoot's configuration is ConstrainedOnMobiles, 960*640, Content Height Fit is select.

8
NGUI 3 Support / UIDragObject Problems in NGUI 3.7.2
« on: September 22, 2014, 04:03:35 AM »
Hello guys, I had a problem when i use UIDragObject Component in NGUI 3.7.2 .

My default resolution is 960*640. It only woks well in 960*640. The drag object's left can match screen's left.

But when i convert resolution to 800*480 , the problem appears. The drag object's left cannot match screen's left any more.

It works well in the old NGUI editions.

I have no idea how it becomes so. Please help me !!! Thanks ~



Pages: [1]