- Home /
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.
Your answer
Follow this Question
Related Questions
how to save and load game through unity Serializer 0 Answers
How to store texture and color of gameobject 0 Answers
Cloud recognition in Vuforia 0 Answers