I have dice roller app. When dice is stoped i detect the value like this:
IEnumerator Counter(){
yield return new WaitForSeconds (0.1f);
if (speed > 0) {
check = true;
gui.fontSize = -50000;
} else {
gui.fontSize = 30;
}
if (speed == 0) {
float maxY = 0f;
Transform upFace = null;
foreach (Transform face in faces) {
if (face.position.y > maxY) {
maxY = face.position.y;
upFace = face;
}
}
if (check == true) {
//Debug.Log (upFace.name);
result = upFace.name;
gui.text = "You are rolled: " + result;
PlayerPrefs.SetString ("DiceResult",Time.time +" You rolled " +result);
consoleResult = PlayerPrefs.GetString ("DiceResult");
Debug.Log (consoleResult);
check = false;
yield return new WaitForSeconds (1f);
}
}
}
But now it`s not a log. I just overwrite the value after each roll.
I want create a log. After each roll the value must been save in PlayerPrefs and if you want you can see all of your result.
Question 1: How create log by PlayerPrefs?
Question 2: How output the values? ( Many empty GUI.Text components?)