When I use Action:Add scene to load a subscene,it runs smoothly at the first time.But after that,every time when this scene added,the program was stuck for a short time.I traced the codes and found in below
Object[] prefabAssets = Resources.LoadAll ("SaveableData/Prefabs", typeof (GameObject));
if (prefabAssets == null || prefabAssets.Length == 0)
{
=====>prefabAssets = Resources.LoadAll ("", typeof (GameObject));
}
prefabAssets = Resources.LoadAll ("", typeof (GameObject));
I'm sure this line caused this problem.
How to resolve this problem?Thanks.
Comments
Basically, you want to move any Resources files required by save games into subfolders. If you have none for a given type, create a "dummy" prefab folder with a dummy asset inside it.