public void beamMeUpScotty() { theAnswers = new allUserResponses(); if (PlayerPrefs.HasKey("responses")) { string jsonString = PlayerPrefs.GetString("responses"); theAnswers = JsonUtility.FromJson <allUserResponses>(jsonString); } theAnswers.allUserResponsesList.Add(new userResponseEntry(3, "Howard Stern")); theAnswers.allUserResponsesList.Add(new userResponseEntry(6, "Spiderman")); }
// Start is called before the first frame update void Start() { GUILayout.BeginArea(new Rect(Screen.width * 0.1f, Screen.height * 0.1f, Screen.width * 0.3f, Screen.height * 0.1f)); theAnswers = new allUserResponses(); if (PlayerPrefs.HasKey("responses")) { string jsonString = PlayerPrefs.GetString("responses"); theAnswers = JsonUtility.FromJson <allUserResponses>(jsonString); } theAnswers.allUserResponsesList.Add(new userResponseEntry(3, "Howard Stern")); theAnswers.allUserResponsesList.Add(new userResponseEntry(6, "Spiderman")); }