Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: hmnyari on June 24, 2013, 08:21:20 PM
-
hello. I have a question for performance of my project .
I'm Pro user using 2.6.3
I have a draggable UITable and there are almost 100 object in the table.
and 100 object has own UIPanel
panel(UIPanel),(UIDraggablePanel)
- table (UITable)
-PlayerBox (UIPanel)(UIDragContents)
-label(UILabel) -activeOn
-icon(UISprite) -activeOff
-lable_status (UISprite) -activeOn or Off
-img (UITexture) -activeOff
-protect (UISprite) -active Off
-PlayerBox (UIPanel)(UIDragContents)
-label(UILabel) -activeOn
-icon(UISprite) -activeOff
-lable_status (UISprite) -activeOn or Off
-img (UITexture) -activeOff
-protect (UISprite) -active Off
...100 PlayerBoxes
Panel Clip doesn't work because of UIPanel in UIPanel
so I'm using (OnBecameVisible, OnBecameInvisible) script
(using iPhone 5)
if i do nothing frame rate is 60
but when i start to drag , frame rate change to 20~30
I want to know why my dragpanel performance is bad.
because of object has UIPanel or another reason?
my destination is 200 object move smoothly.
help me please. thank you
-
how come each PlayerBox need an UIPanel if they are not overlapped ?
-
A very good question. It would be much more per-formant if you One panel for all the players together (that panel should have the UIDraggablePanel script that you are probably missing (according to your screenshoot)).
-
Remove the UIPanel on each playerbox and have the draggablepanel draw it. Select "Cull" on that UIPanel.
It should improve greatly then.
-
Remove the UIPanel on each playerbox and have the draggablepanel draw it. Select "Cull" on that UIPanel.
It should improve greatly then.
thank you but I have problem if playerbox has no UIPanel.
Would you please see this video?
http://www.youtube.com/watch?v=pbsubaS4t7k
this is my problem between playerbox has UIPanel and don't have UIPanel
I can handle UISprite'depth using z-depth(UIPanel) and z-Position(Transform) but dynamic font is not working.
I want to do second behavior without UIPanel
Is there any solution?
-
OK, I see what you're trying to do.
I would do it like this:
Remove the default UIPanel on the player box.
When you change the playerbox state to be draggable, add a UIPanel to the playerbox or spawn a secondary playerbox instead and have this one have it's UIPanel as you do now. When you release it, you can remove that UIpanel again.
Does that help?
-
OK, I see what you're trying to do.
I would do it like this:
Remove the default UIPanel on the player box.
When you change the playerbox state to be draggable, add a UIPanel to the playerbox or spawn a secondary playerbox instead and have this one have it's UIPanel as you do now. When you release it, you can remove that UIpanel again.
Does that help?
Thank you for answer me
but performance is not changed.
when I start drag , frame down to 20~30
when stop dragging ,frame up to 60
I think problem is not UIPanel
maybe problem is dragpanel script series
I recorded profiler but I don't understand this result means;;
watch this at 1080p please
http://www.youtube.com/watch?v=CmOqQeWo1BM
thank you :)
-
As far as I can see, it seems to be a side-effect of dragging. If you notice, the majority of CPU time is used on UpdateGeometry(), which suggest to me that the playerbox you're dragging around is still being drawn by the "big" UIPanel with the draggablepanel on, which means the whole thing needs UpdateGeometry every update. Look into the Drag&Drop example that comes with NGUi on how to properly change the UIPanel run-time. I'm certain getting this done right will improve performance.
-
Also, the GC seems to spike crazy when you're dragging, that suggests to me that you're ot using the newest version which has massive performance improvements with just this problem.
-
Looking at the original video, you seem to have "New" text fading in and out on every single label.
Doing this causes the entire buffer to rebuild every single frame.
You need to stop doing this if you care about performance. Changing things every frame is VERY BAD for performance.
-
thank you Nicki , ArenMook
Looking at the original video, you seem to have "New" text fading in and out on every single label.
Doing this causes the entire buffer to rebuild every single frame.
You need to stop doing this if you care about performance. Changing things every frame is VERY BAD for performance.
maybe New is not problem. Even if I delete New label result is same .
I tested NGUI example (scroll) using 100 object
test was really fast. always 60fps
I think problem is my scene (but I don't know what is problem..)
When I figure out the reason I will notify you
thank you spend time for me :)