I am using unity serializer’s checkpoint functions to load and save my game. I have a game object that simply resumes the game or starts a new one depending on if there is a checkpoint or not. This is the code:
using UnityEngine;
using System.Collections;
using Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
using System.Collections.Generic;
using System;
using System.Linq;
public class LoadingScript : MonoBehaviour {
// Use this for initialization
void Start () {
if (LevelSerializer.CanResume == true) {
Debug.Log ("Canresume");
LevelSerializer.Resume ();
}
else {
Application.LoadLevel("Title Screen");
}
}
// Update is called once per frame
}
What happens though is that LevelSerializer.CanResume always returns true and it keeps on resuming the checkpoint and spawning more and more gameobjects. Also I keep on getting the error from the title of this question. What am I doing wrong? Thank You so much!