Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

ScrollRect performance drop hardly when drag

Discussion in 'UGUI & TextMesh Pro' started by WimLI, Aug 6, 2015.

  1. WimLI

    WimLI

    Joined:
    Mar 31, 2015
    Posts:
    9
    in my scrollrect have about 200 child item,when drag, i found the eventsystem.update() take about 60% ,about 6.93ms,and the scrollrect.laterupdate() take about 21.4%, aout 2.45ms. all these make the FPS drop hardly.

    is there some solution,by the way, every item is a panel with a button component,and in the panel there is some pic and text.
     
  2. WimLI

    WimLI

    Joined:
    Mar 31, 2015
    Posts:
    9
    in my another case ,i found the Canvas.BuildBatch() takes more time than the scrollrect.laterupdate().
     

    Attached Files:

  3. Cromfeli

    Cromfeli

    Joined:
    Oct 30, 2014
    Posts:
    202
    Are all those items visible on screen at same time when scrolling? You have probably read that having items within scroll rect means all of them will be updated every frame, when scroll rect is moving. So I would suggest, assuming I understand your case, to build mechanics that allow you to reduce the amount of objects for those that are outside of screen (Dynamically populate smaller amount of objects that come to screen).

    If this can not be realized, then I am a bit out of advice unfortunately.
     
  4. l3fty

    l3fty

    Joined:
    Mar 23, 2013
    Posts:
    86
    As a test, if you remove the button does it have the same impact during a drag? I'm guessing they could be recalculating all their bounds for the enter/exit events while dragging. If that was the case, perhaps disabling those components while dragging could solve it.
     
  5. WimLI

    WimLI

    Joined:
    Mar 31, 2015
    Posts:
    9
    all the item is controled by the vertical layout group and content size fitter, so even some item is invisible, i still can't disable them,this will leadto item jump.