• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Jul 15, 2013 at 03:19 PM by davidflynn2 for the following reason:

This issue seems to have been caused by a cache file that needed to be cleared.

avatar image
0
Question by davidflynn2 · Jul 15, 2013 at 01:59 PM · c#savegame save

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();
         }
  
      }
             
 }
 
Comment
Add comment · Show 6
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image InfiniBuzz · Jul 15, 2013 at 02:02 PM 1
Share

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?

avatar image davidflynn2 · Jul 15, 2013 at 02:05 PM 0
Share

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.

avatar image davidflynn2 · Jul 15, 2013 at 02:11 PM 0
Share

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.

avatar image InfiniBuzz · Jul 15, 2013 at 02:13 PM 1
Share

what methods are you using to save the game?

avatar image InfiniBuzz · Jul 15, 2013 at 02:20 PM 1
Share

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?

Show more comments

0 Replies

  • Sort: 

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

PlayerPrefs - Can I save more than one? 1 Answer

How do I save a custom class of variables to playerprefs? 2 Answers

Spawning off size blocks 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges