Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

What exactly does Image.Start() do?

Discussion in '2018.1 Beta' started by Sloane, Apr 26, 2018.

  1. Sloane

    Sloane

    Joined:
    Aug 7, 2014
    Posts:
    5
    It sometimes, not always, causes a lot of GC when I'm moving a GameObject with a World Space Canvas attached.

    Tried to deep profile it, the increase in frame time still happens but the spike doesn't show up in the profiler at all for some reason, so no way for me to investigate further.

    Never seen anything like it. Any ideas?

     
  2. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    UnityEngine.UI.Image and its base classes do not actually have a start method, let alone a Start() coroutine. This seems to be some other Image class in your project, could you check for any third party assets that have a class with that name? The major allocation source shown there is the LogStringToConsole, check for any errors or debug messages in the console.
     
    LeonhardP likes this.
  3. Sloane

    Sloane

    Joined:
    Aug 7, 2014
    Posts:
    5
    Thanks for your reply. No Image class in my scripts or plugins. Got rid of the console messages, wasn't it. GC and calls actually tripled now for some reason.

    Any idea why the spike wouldn't register when deep profiling?



    Edit: I was wrong about the World Space Canvas having anything to do with it though. Happens when it is disabled, too.

    Edit #2: This is what it looks like in the Deep Profiler. Frame time is completely off and nothing really registers. There are no errors logged or exceptions being thrown though.

     
    Last edited: Apr 26, 2018
  4. wx3labs

    wx3labs

    Joined:
    Apr 5, 2014
    Posts:
    77
    I see Image.Start() in my profiles as well, although only when I profile a build, not when I profile from the editor. My suspicion is that it's actually part of the profiler's instrumentation.