Menu Framework Load Scene
Menu Framework Load Scene
Hi, I'm having an issue, I'm not sure if its unity in general issue or the menu framework, if I load Menu then Scene 1 again and again, afterwards the game froze, and I checked the profiler this shows (im new to profiler so idk)
- Attachments
-
- profiler.png (95.96 KiB) Viewed 232 times
Re: Menu Framework Load Scene
Hi,
There may be something in your Scene 1 that isn't cleaning up after itself or is getting into an infinite loop.
You could temporarily eliminate the Menu Framework from the possibilities by replacing the main menu scene with a small test scene that has a UI button to load Scene 1, and then add a UI button to Scene 1 that loads the main menu scene.
In fact, you could eliminate the Dialogue System's save system, too, by configuring the button to call SceneManager.Loadscene(), such as in this script:
If that works, try replacing SceneManager.LoadScene(sceneName) with:
This will involve the save system but not the Menu Framework.
There may be something in your Scene 1 that isn't cleaning up after itself or is getting into an infinite loop.
You could temporarily eliminate the Menu Framework from the possibilities by replacing the main menu scene with a small test scene that has a UI button to load Scene 1, and then add a UI button to Scene 1 that loads the main menu scene.
In fact, you could eliminate the Dialogue System's save system, too, by configuring the button to call SceneManager.Loadscene(), such as in this script:
Code: Select all
using UnityEngine;
using UnityEngine.SceneManagement;
public class BasicSceneLoader : MonoBehaviour
{
public void LoadScene(string sceneName) // <-- Configure UI button's OnClick() to use this.
{
SceneManager.LoadScene(sceneName);
}
}
Code: Select all
PixelCrushers.SaveSystem.LoadScene(sceneName);
Re: Menu Framework Load Scene
Hi, I tried it on a new empty project, and used the code you suggested, and the issue is still there. I tried another profiler with deep profile (for some reason the first post screenshot didn't show it)
- Attachments
-
- profiler2.png (210.86 KiB) Viewed 226 times
Re: Menu Framework Load Scene
Code: Select all
public virtual void ReturnToTitleMenu()
{
SaveSystem.BeforeSceneChange();
SaveSystem.LoadScene("index:" + FindObjectOfType<TitleMenu>().titleSceneIndex);
//SaveSystem.sceneLoaded += OpenTitleMenuOnSceneLoaded;
}
private void OpenTitleMenuOnSceneLoaded(string sceneName, int sceneIndex)
{
//SaveSystem.sceneLoaded += OpenTitleMenuOnSceneLoaded;
FindObjectOfType<TitleMenu>().titleMenuPanel.Open();
}
Re: Menu Framework Load Scene
Thank you for the info. I’ll check the original Menu Framework code to make sure it’s properly using “-=“ to unhook.