Exemplo n.º 1
0
 public void StartRecording()
 {
     rP             = new ReplayPath(timeBetweenNodes);
     recordingNodes = true;
     print("Recording.");
     StartCoroutine(CreateNodes());
 }
Exemplo n.º 2
0
    public void Load()
    {
        if (File.Exists(Application.persistentDataPath + "/replayTest.dat"))
        {
            BinaryFormatter bf   = new BinaryFormatter();
            FileStream      file = File.Open(Application.persistentDataPath + "/replayTest.dat", FileMode.Open);
            rP = (ReplayPath)bf.Deserialize(file);
            file.Close();

            timeBetweenNodes        = rP.TimeBetweenNodes;
            this.transform.position = rP.GetNode();
            nextNode = rP.GetNode();
            moveRate = CalculateMoveRate();
        }
        else
        {
            print("File not found, destroying Ghost");
            Destroy(this.gameObject);
        }
    }