Blank UnityEngine.TextAsset

Hi,

I was printing out everything that’s existing after a transition to an empty scene after loading a full map in Unity 5.4.5.

The thing is that after each transition to the empty scene, from a full map, there is 200 more UnityEngine.TextAsset laying around and they all have no name, no data and the instance ids in the negative range.

I’ve looked around the data we use and I can’t figure out where it’s coming from. Does anyone have any idea?

How are you finding these objects?

I’m using Resources.FindObjectsOfTypeAll(typeof(T))
where T in this case is UnityEngine.TextAsset

This returns objects in the Project, not the Scene. Is that your intention?

Also unrelated note but is there not a template version of the function? Should be faster than typeof(T) and mitigates the need for the cast

Excuse my derailing

I’d use Unity’s Memory Profiler to take a snapshot while the game is in that empty scene and then inspect that snapshot to see what is holding a reference to those TextAsset’s.

https://bitbucket.org/Unity-Technologies/memoryprofiler