Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by briand3d · Feb 19, 2013 at 05:03 PM · lagezgui

Using EZGUI can I Create large amounts of listObjects without lag

Using a ScrollList, I am currently creating and deleting large amounts of UIlistObjects on the fly. Each ListObject has 4 SpriteText children, whose text also updated upon creation.

The creation of a few, or even 100 listobjects, is done quickly, but when I reach numbers such as 300, or 500, there are large amounts of Lag. Also, while using UIListObjects, I realized that all children, of that listObject, would not be clipped correctly.

A Fix I tried : I tried putting the "create listObject", and "add listObject to UIList" code in an CoRoutine function, then after every 100 listObjects created, I called a "yield WaitForSeconds(.0001f)" This seemed to work, except still lags when values are extremely high, such as in the thousands.

To fix the clipping issue, I used UIListObjectContainers instead of UIListObject, however, when being created in a CoRoutine, the UIListObjectContainers jumble on top of one another.

Is these a way to create large amounts of UIListObjectContainers without lag? if Not, is there a way to create them via CoRoutine, with something like a yield WaitForSeconds(.0001f), and NOT jumble on top of each other?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by robertbu · Feb 19, 2013 at 05:35 PM

You should edit your title to include EZGUI so folks who know EZGUI might be drawn to your question.

As for your lags, if you have pro, profile your app and see what is going on. A year ago I tackled a similar project using EZGUI. I found most of the performance hit was in the scroll list code for what I was doing (not in the item creation code). My solution was to write my own, much simpler scroll list. My simpler code did not have clipping, so I placed a texture on a plane in front with a transparent cutout. The performance improvement was huge. Display times went from seconds to tenths of seconds. I also deferred the destruction of game object, which also had a big impact.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image robertbu · Feb 19, 2013 at 07:26 PM 0
Share

What are the simple sprites displaying? Are they something dynamically loaded, or do they come from a set of images you know at compile time?

avatar image briand3d · Feb 19, 2013 at 09:33 PM 0
Share

Thanks robertbu

Im sorry, I meant SpriteText, not SimpleSprites ( I will update the question accordingly ) The SpriteTexte are updated dynamically, its a bunch of double and float values,

However, I dont think its the changing of these values that cause much lag, when I adjust all of these values, without adding or removing ListObjects, or ListObjectContainers,- or add objects without changing any values, I get no Lag.

I am going to look into writing my own ScrollList, but that seems like a huge undertaking.

avatar image robertbu · Feb 19, 2013 at 10:24 PM 0
Share

I just look at my scroll list code. It is around 350 code lines. Of that there is around 100 lines you would not need for your purpose.

But maybe you can work around your issues. I did a demo for a dynamic outline using EZGUI at one point. I don't remember exactly how it was done, but I reduce the line height to 0 for hidden items (may have turned off the renderer as well). $$anonymous$$aybe you can do something similar. That is populate the list with 500 items to start, but collapse all that you don't use. Then when want to add/subtract/change, reset all the sprite text starting with the first item to change and then call RepositionItems() on the scroll list.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Lag on Collision from Projectile 1 Answer

Big FPS drop when using SetHeights on terrain 2 Answers

Why does this script lag so much? 2 Answers

Low FPS with charachter animation 1 Answer

why my android game lag when getting data from online mysql 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges