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

Strategy game file saves help

Discussion in 'Editor & General Support' started by Fuzzypup, Dec 20, 2013.

  1. Fuzzypup

    Fuzzypup

    Joined:
    Aug 13, 2013
    Posts:
    190
    I've been looking all day for how to save data in Unity. I'm losing my mind since I am new to C#.

    I have lots of map and unit data to save and I can't find a plausible way other than going back to simple C file functions.

    I need a game manager between scenes ok.
    I need static variables so it can pass between scenes ok.
    I need to serialize my data to save to file ok.
    I need to make an instance of my manager to serialize it to save.... I can't because you can't instantiate a class with static variables, SCREAM!!!

    I feel like I just have to write my own code to do this manually.

    Suggestions?
     
  2. probbins

    probbins

    Joined:
    Oct 19, 2010
    Posts:
    216
  3. Fuzzypup

    Fuzzypup

    Joined:
    Aug 13, 2013
    Posts:
    190
    Actually I taught myself how to do it via binary saves without serialization. It's more work but it does the job perfectly. You can use static data.