Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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: 

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

Die Function Help With C# 1 Answer

Call StartCoroutine() from inside a function other than Start!? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges