public override void WriteObjectsIdsAndNames() { var entities = new List <ReplayEntity>(); var i = 0; foreach (var replayEntity in ReplayEntities.Where(replayEntity => !BaseFrame.FrameEntities.Contains(replayEntity))) { entities.Add(replayEntity); i++; } var j = 0; foreach (var replayEntity in BaseFrame.FrameEntities.Where(replayEntity => !ReplayEntities.Contains(replayEntity))) { entities.Add(replayEntity); j++; } ReplayWriter.Write((byte)(i + j)); for (var z = 0; z < (i + j); z++) { ReplayWriter.Write(entities[z].Id); if (z < i) // instantiate those { ReplayWriter.Write(entities[z].GameObjectName); } else if (z < (j + i)) // delete those { ReplayWriter.Write(""); // u dont need the name for objects to delte cause they exist already } } }
public override void WriteObjectsIdsAndNames() { ReplayWriter.Write(ReplayEntities.Count); foreach (var replayEntity in ReplayEntities) { ReplayWriter.Write(replayEntity.Id); ReplayWriter.Write(replayEntity.GameObjectName); ReplayWriter.Write(replayEntity.transform.position); ReplayWriter.Write(replayEntity.transform.rotation); } FrameEntities = new List <ReplayEntity>(ReplayEntities); }
protected void WriteFrameTime(float time) { ReplayWriter.Write(time); //Debug.Log("Frametime Write " + FrameTime); }
protected void WriteDeltaFrameCount(float deltaFrames) { ReplayWriter.Write((byte)deltaFrames); }
public void Write(string path) { ReplayWriter.Write(this, path); }