Quantcast
Viewing latest article 13
Browse Latest Browse All 54

Getting white screen on load through unity serializer

I am trying to save the state of a single gameobject in my scene which contains the clones that genrate at runtime . containing only serialisable types. I have added the SaveManaer to my scene, and added a StoreInformation script to the object containing the array. There is no other information be stored in my scene. However, when I load the scene n the Start function of the scene, I just get a white screen instead of my game. The Log shows me that the save state is loaded and i see no errors or exceptions in the log. However, my scene does not appear in the Game View. Pausing the game I can see all the objects I would expect with no errors. function Start () { // Load save state, used for achievements object // First check if we already have a save state if(PlayerPrefs.HasKey(“AchSave”)) { var AchSave : String = PlayerPrefs.GetString(“AchSave”, null); if(AchSave) { // Load it LevelSerializer.LoadSavedLevel(AchSave); Debug.Log(“Loaded Save State”); } else Debug.Log(“Save State does not exist”); } } function OnDestroy() { // Save state of Achievements var AchSave : String = LevelSerializer.SerializeLevel(); // Write ro player prefs PlayerPrefs.SetString(“AchSave”, AchSave); Debug.Log(“Saved State”); } i tried to figure it out,got to know somehow my load function on start call 2 times.why so cont know.

Viewing latest article 13
Browse Latest Browse All 54

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>