Example #1
0
    private void Awake()
    {
        // if the singleton hasn't been initialized yet
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
        }

        instance = this;
        DontDestroyOnLoad(this.gameObject);


        if (SaveLoad.TestFile() == true)
        {
            SaveLoad.Load();
            SaveLoad.Save();
        }
        else
        {
            SaveLoad.saverData.Add(new SaveLoad.ProgressSaver());
            SaveLoad.Save(); SaveLoad.Load();
        }
    }
 private void Awake()
 {
     _instance = this;
 }