Exemple #1
0
    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else if (Instance != this)
        {
            Destroy(gameObject);
        }



        DontDestroyOnLoad(gameObject);



        Load();

        Debug.Log(HelperScript.Serialize <SaveState>(state));
    }
Exemple #2
0
    //Save the whole state of this saveState script to the player prefab

    public void Save()
    {
        PlayerPrefs.SetString("save", HelperScript.Serialize <SaveState>(state));
    }
Exemple #3
0
 public void Save()
 {
     m_saveState.m_highScore = GameController.Instance.m_highScore;
     PlayerPrefs.SetString("Save", HelperScript.Serialize <SaveState>(m_saveState));
 }