Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Script reference causes slow editor

Discussion in 'Editor & General Support' started by Ekibyo_Kaim, Dec 7, 2019.

  1. Ekibyo_Kaim

    Ekibyo_Kaim

    Joined:
    Mar 5, 2015
    Posts:
    11
    Hi everyone,

    I'm posting today because, in all my time working with Unity, I never found something so weird.

    My Editor have been real slow for a few weeks, and I think i discovered why (or at least a beggining of answer).

    the Symptoms: navigating in the project was kinda slow, and renaming a folder was like, I type the new name, and i can go grab a cup of coffe while the folder rename itself, letter by letter.
    You can see the editor profiler down there to illustrate
    Annotation 2019-12-07 103017.png

    And I just discovered what caused that. My project consist of screens (prefabs) doing stuff, then calling the next one. (the game is a point and click)
    To do so, I have a main script in every screen called "GameScreenController.cs" and it reference the next screen prefab to be loaded in a GameScreenController variable.
    Annotation 2019-12-07 192428.png

    and thats the issue. if the variable is set to null, and i just loaded the editor, no problem, everything works fine. But if i go to a scene, or a prefab folder containing an object with this script referencing the next. Everything slows down.

    I was wondering i someone had an idea of whats going on (and maybe how I could repair that).

    My mind was on the reference was set in the memory, and the reference of the reference and so on and so on, but the task manager and the profiler doesn't show anything suspicious...

    Anyway, thank you for reading that weird story :/