I have a problem where for about 10-20 seconds after my game becomes active to the player, performance is poor with very pronounced stuttering. Immediately after that, it runs perfectly smooth which was causing me to suspect there were resources still being loaded despite the game being “playable”.
I tried hooking into the sceneLoaded event as implemented below, but it is indicating that the scene is loaded well before the performance issues have cleared up.
Are there any other reasons that may account for the delay in acceptable performance I am seeing?
Thanks.
void OnEnable()
{
SceneManager.sceneLoaded += OnSceneLoaded;
}
void OnDisable()
{
SceneManager.sceneLoaded -= OnSceneLoaded;
}
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
Debug.Log("Scene fully loaded");
// Do post-load stuff
}