Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Local History - Unity Auto Backup

Discussion in 'Assets and Asset Store' started by friuns3, Aug 20, 2014.

  1. friuns3

    friuns3

    Joined:
    Oct 30, 2009
    Posts:
    307


    Local History for Unity3d automatically creates a history of your files every time they are saved. You can restore file to any point of time when its modified.

    Works with unity free versions.




    https://www.assetstore.unity3d.com/en/#!/content/20930

    Please write here bug reports and feature requests!
     
    Last edited: Aug 26, 2014
  2. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    very usefull
     
  3. nathantran

    nathantran

    Joined:
    Mar 16, 2014
    Posts:
    11
    friuns3,

    Nice plugin. Would be perfect if you add the feature to autosave on play and on a set interval.

    Thanks.
     
  4. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,457
    Cool plugin. Are you saving the diff of the file ?
     
  5. deroesi

    deroesi

    Joined:
    Feb 1, 2014
    Posts:
    18
    i get errors when saving using your asset and Unity 4.6.1..... I updated from 4.5 (in which everything worked...) to 4.6.1 recently.. could you update the asset, please? (or is this a problem on my end?)

    thanks!
     
  6. Olivierlr

    Olivierlr

    Joined:
    Jul 4, 2014
    Posts:
    14
    Nice asset but crashes in Unity 5.0 - when can we expect an update.
     
  7. friuns3

    friuns3

    Joined:
    Oct 30, 2009
    Posts:
    307
    Hi i noticed that too, here is fix in localhistory.cs

    Code (CSharp):
    1.  
    2.   static void OnWillSaveAssets(string[] importedAssets)
    3.     {
    4.         foreach (string str in importedAssets)
    5.         {
    6.            
    7.             var lower = Path.GetExtension(str).ToLower();
    8.             if (formats.Any(a => a == lower))
    9.             {
    10.                 string destFileName = PostFix(str);
    11.                 if (!File.Exists(destFileName))
    12.                 {
    13.                    
    14.                     Directory.CreateDirectory("History/" + Path.GetDirectoryName(str));
    15.                     FileMove(str, destFileName);                    
    16.                 }
    17.             }
    18.         }
    19.     }
    20.  
    replace with
    Code (CSharp):
    1.  
    2.    
    3.   static void OnWillSaveAssets(string[] importedAssets)
    4.     {
    5.         foreach (string str in importedAssets)
    6.         {
    7.            
    8.             var lower = Path.GetExtension(str).ToLower();
    9.             if (formats.Any(a => a == lower))
    10.             {
    11.                 string destFileName = PostFix(str);
    12.                 if (!File.Exists(destFileName))
    13.                 {
    14.                    
    15.                     Directory.CreateDirectory("History/" + Path.GetDirectoryName(str));
    16.                     FileMove(str, destFileName);
    17.                     File.WriteAllText(str, "");
    18.                 }
    19.             }
    20.         }
    21.     }
    22.  
    source code can get here https://www.assetstore.unity3d.com/en/#!/content/20930
     
    Last edited: Apr 22, 2015
  8. Olivierlr

    Olivierlr

    Joined:
    Jul 4, 2014
    Posts:
    14
    Hi, thanks for the fix. You need to skip the new added line when called from a load function if not it will mess things up on load. I've implemented these two changes and now it's been stable for several days.
     
  9. grimmy

    grimmy

    Joined:
    Feb 2, 2009
    Posts:
    409
    Your asset deleted my main game scene. I don't have a recent backup (because that's partly why I bought your asset).Thanks

    I think you have a responsibility to either update your asset, or remove it from the asset store before it happens to anyone else. It's a pretty dangerous asset as it stands... ie an asset which claims to backup your files but actually deletes them.

    Cheers
     
    Last edited: Oct 22, 2015
    s-ta-c likes this.
  10. Bruno2Silva2

    Bruno2Silva2

    Joined:
    Mar 26, 2015
    Posts:
    17
    Your asset don't work correctly, this system deleted my main game scene, and Unity Close without saving...

    To fix the problem I had to go in the project folder where are the historical of your system and change the format of the scene that had changed the directory and the extension ...
    Correct it or take the assetstore!!! :cool:
     
  11. manchester123

    manchester123

    Joined:
    Dec 21, 2020
    Posts:
    1
    Local History doesn't appear under windows. I clicked on new scene to create a health bar then my original scene I could not get back to. I'm using the 2019 version of unity. Any ideas please? Thanks. All my Assets and scripts are still there