public static void SaveScore(SunGoku score) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/score.sav"; FileStream stream = new FileStream(path, FileMode.Create); GameData data = new GameData(score); formatter.Serialize(stream, data); stream.Close(); }
// Start is called before the first frame update void Start() { pauseActive = false; pauseScreen.SetActive(false); gameOverScreen.SetActive(false); Cursor.lockState = CursorLockMode.Locked; player = PlayerManager.instance.player; controller = player.GetComponent <PlayerController>(); dayNnite = FindObjectOfType <SunGoku>(); }
public GameData(SunGoku sungoku) { daysAlive = sungoku.daysAlive; }