/// <summary> /// 在Patch中生成新加Entity的信息 /// </summary> /// <param name="rightEntity"></param> public override void OnLeftEntityMissing(IGameEntity rightEntity) { var addEntityPath = AddEntityPatch.Allocate(); addEntityPath.Key = rightEntity.EntityKey; logger.DebugFormat("AddEntityPatch ::{0},", rightEntity.EntityKey); foreach (var comp in rightEntity.ComponentList) { AddComponentPatch patch = AddComponentPatch.Allocate(comp); addEntityPath.AddComponentPatch(patch); patch.ReleaseReference(); } snapshotPatch.AddEntityPatch(addEntityPath); addEntityPath.ReleaseReference(); }