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

Saving .asset files not working.

Discussion in 'Scripting' started by DarkGolemGames, Apr 12, 2015.

  1. DarkGolemGames

    DarkGolemGames

    Joined:
    Dec 23, 2014
    Posts:
    7
    I'm creating new asset files while in Play mode, editing them in-game, then saving them before finally quitting Play Mode. Up until this point, everything works fine, but when I enter Play Mode again, everything that was changed about my assets are reset but the actually .asset file itself remains.
     
  2. sesalpinogamer

    sesalpinogamer

    Joined:
    Apr 25, 2013
    Posts:
    13
    Strange...Try saving the scene,closing the unity,going back and tell me if your changes are there
     
  3. DarkGolemGames

    DarkGolemGames

    Joined:
    Dec 23, 2014
    Posts:
    7
    Nope. I don't understand why the changes are saved when I exit Play Mode but are reverted when I re-enter Play Mode.
     
  4. sesalpinogamer

    sesalpinogamer

    Joined:
    Apr 25, 2013
    Posts:
    13
    Ummmmm....My only guess right now is that it is a unity error,what version are you using?Also,try building a developer version of the game,right after making and saving the changes,and see if it works.
     
  5. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Could you give an example. What are you changing while in play mode?
     
  6. DarkGolemGames

    DarkGolemGames

    Joined:
    Dec 23, 2014
    Posts:
    7
    A list of Vector2.


    Code (CSharp):
    1. [Serializable]
    2.             public class MyClass
    3.             {
    4.  
    5.                 [SerializeField] private List<Vector2> points = new List<Vector2>();}
    Now it saves until the next time I hit Play Mode but when I restart the Editor all changes are lost.
     
  7. DarkGolemGames

    DarkGolemGames

    Joined:
    Dec 23, 2014
    Posts:
    7
    I'm not sure why but sometimes the changes stick even after restarting the editor but at other times they don't.
     
  8. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Do you have a reliable reproduction?
     
  9. sesalpinogamer

    sesalpinogamer

    Joined:
    Apr 25, 2013
    Posts:
    13
    It may be a issue with the source code,i think only dantus can help ya