- Home /
This issue seems to have been caused by a cache file that needed to be cleared.
UnitySerializer Only Saving one Game Problem
I know that UnitySerializer has its own forum but there is no one on it that uses it any more and you cant get help. I am hoping some one here my have used this product and hit this same issue and fixed it.
When playing the game you can click the save button and save the games just fine and they load up just fine but when I close the game build and reopen it, it only shows one game save.
Here is the save script I am using:
using UnityEngine;
using System.Collections;
public class GrassSaveGame : MonoBehaviour
{
public GUISkin Box;
public GUISkin Box2;
public string gameName = "Your Game";
private string box;
private bool paused;
//Awake is called when the script instance is being loaded.
void Awake ()
{
LevelSerializer.MaxGames = 5;
}
// Update is called once per frame
void Update ()
{
if(Input.GetKeyUp(KeyCode.P))
{
paused = !paused;
if(paused == true)
{
Time.timeScale = 0.0f;
//if(pausedGUI) pausedGUI.enabled = true;
}
else
{
Time.timeScale = 1.0f;
// if(pausedGUI) pausedGUI.enabled = false;
}
}
}
void OnGUI ()
{
if (paused)
{
GUILayout.BeginArea(new Rect(400,200, 300, 400));
GUILayout.BeginVertical();
GUILayout.FlexibleSpace();
GUI.skin = Box;
if(GUI.Button(new Rect(55,0,200,55),box))
{
LevelSerializer.SaveGame(gameName);
}
GUILayout.Space(5);
foreach(var sg in LevelSerializer.SavedGames[LevelSerializer.PlayerName])
{
if(GUILayout.Button(sg.Caption))
{
LevelSerializer.LoadNow(sg.Data);
Time.timeScale = 1;
}
}
GUILayout.EndVertical();
GUILayout.FlexibleSpace();
GUILayout.EndArea();
}
}
}
Hi I dont really get your problem. You want to have the savegames after rebuilding the entire game? Or you mean after restarting the game you only have one savegame?
I did a pc build of my game to see how its working and it works great as long as that game is open. The moment I close the pc build and reopen it, it only has one savegame.
It does the same in the Unity3d if I press the play button the create a few saves they will load fine until I press the play button again. When I yet again press the play button there is only one save game showing.
Uhm I'm not sure but did you try to change the gameName string to something unique for each savegame? e.g. add a number at the end?
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
PlayerPrefs - Can I save more than one? 1 Answer
Die Function Help With C# 1 Answer
Call StartCoroutine() from inside a function other than Start!? 2 Answers