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

Deepprofile emptys maindictionary

Discussion in 'Scripting' started by rainbow_design, Aug 28, 2017.

  1. rainbow_design

    rainbow_design

    Joined:
    Aug 8, 2015
    Posts:
    108
    Hello,

    Edit: The code is just to illustrate how i tried to debug no need to read it.

    I came some time ago around a strange issue which sometimes occured:
    My script stops responding to most input.

    Now i tried to trace the issue.

    I added this to my update:
    Code (CSharp):
    1.  
    2.         if (g.timer % 100 == 1) {
    3.             options = File.ReadAllLines (Path.Combine (p.gamesetpath, "update.glo"));
    4.             if (options.Contains ("false")) {
    5.                 Debug.Log (gs.globaltemplate.Count);
    6.                 return;
    7.             }
    8.             if (options.Contains ("end")) gameflow.quitprogram ();
    9.         }
    It tells me gs.globaltemplate.Count is 0.

    moreover i added and extra button to stop update:


    Code (CSharp):
    1.  disablesettings.GetComponent<Button> ().onClick.AddListener (delegate { g.disabled.Add ("update"); });
    And in update:

    Code (CSharp):
    1.  
    2.         if (g.disabled.Contains ("update")) { pre ("update disabled"); return; }
    This button too is dead!

    I figured out: if i now run my app and disable or enable deepprofile this issue happens.

    I think all variables and listeners are wiped then, update is however still running.

    Also i like to add that the script has near 10000 lines now and does use update to create environment and other things.

    Any ideas for the cause or suggestions?
     
    Last edited: Aug 28, 2017
  2. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,824
    I'd actually like to help, but I'm too lazy to wrap my around all the non-intuitive variable names. :D

    *Edit I just remembered that I used deep profiling in a test version of an older project some time ago and it suddenly started to throw null reference exceptions. But the code parts weren't mine and it was an old version anyway, so I did not have a closer look at it, as I thought it was a bug on our side in this specific version.
     
    Last edited: Aug 28, 2017
  3. rainbow_design

    rainbow_design

    Joined:
    Aug 8, 2015
    Posts:
    108
    You dont need to look at the code.
    Its just for illustration.
    This is the problem:

    1. Maindictionary is empty.
    2. Listerner dont work anymore.
    3. update still running.

    4. Right mouse button input script in which is a reference to the main not working script does not work.
    5. the camera rig script which does not refer to the main script does work.
     
    Last edited: Aug 28, 2017