To save and load player data, follow these steps:
- Create a new Unity 2D project and import the game_HigherOrLower package.
- Remove the default scene from the build and add each of the scenes from the imported package to the build in their name sequence (scene0_mainMenu, then scene1_gamePlaying, and so on).
- Make yourself familiar with the game by playing it a few times and examining the content of the scenes. The game starts on the scene0_mainMenu scene, inside the Scenes folder.
- Let's create a class to store the number of correct and incorrect guesses made by the user. Create a new C# script called Player with the following code:
using UnityEngine;
public class Player : MonoBehaviour {
public static int scoreCorrect = 0;
public static int scoreIncorrect = 0;
}
- In the lower-left corner of the scene0_mainMenu scene, create a UI Text GameObject named Text - score containing...