void SendChangeSet(LiveLinkChangeSet entityChangeSet, int playerID) { var buffer = entityChangeSet.Serialize(); LiveLinkMsg.LogSend($"EntityChangeSet patch: '{buffer.Length}' bytes, scene '{entityChangeSet.SceneGUID}'"); m_Connection.Send(LiveLinkMsg.EditorReceiveEntityChangeSet, buffer, playerID); }
static LiveLinkChangeSet SerializeAndDeserialize(LiveLinkChangeSet srcChange) { var resolver = new GlobalAssetObjectResolver(); var bytes = srcChange.Serialize(); // Serialize Changes var resourcePacket = new EntityChangeSetSerialization.ResourcePacket(bytes); foreach (var asset in resourcePacket.GlobalObjectIds) { var manifest = ScriptableObject.CreateInstance <AssetObjectManifest>(); AssetObjectManifestBuilder.BuildManifest(asset.AssetGUID, manifest); resolver.AddAsset(asset.AssetGUID, new Unity.Entities.Hash128(), manifest, null); } // Deserialize LiveLinkChangeSet changeSet; try { changeSet = LiveLinkChangeSet.Deserialize(resourcePacket, resolver); } finally { resourcePacket.Dispose(); resolver.DisposeObjectManifests(); } return(changeSet); }