public void Start()
 {
     if (GameSave.Exists())
     {
         GameData data = GameSave.GetData();
         transform.position = data.playerPosition;
     }
 }
    private void OnDestroy()
    {
        // Save position when player is destroyed
        GameData data = GameSave.GetData();

        data.playerPosition = transform.position;
        GameSave.Instance.Save();
    }
Example #3
0
    private void Start()
    {
        GameData data = GameSave.GetData();

        if (GameSave.Exists())
        {
            // Get the data
            data = GameSave.GetData();
            transform.position = data.playerPos;
            score = data.score;
            transform.rotation = data.playerRot;
        }
    }