private void saveIglooLayoutChanges(System.Action onSyncStopped = null, IIglooUpdateLayoutErrorHandler errorHandler = null) { bool flag = false; foreach (SceneLayoutData item in sceneLayoutDataModified.Keys.ToList()) { if (!sceneLayoutDataModified[item]) { continue; } MutableSceneLayout mutableSceneLayout = new MutableSceneLayout(); ConvertToMutableSceneLayout(mutableSceneLayout, item); foreach (ExtraLayoutInfoLoader extraLayoutInfoLoader in extraLayoutInfoLoaders) { ExtraLayoutInfo extraLayoutInfo = extraLayoutInfoLoader(); mutableSceneLayout.extraInfo[extraLayoutInfo.Key] = extraLayoutInfo.Value; } EventHandlerDelegate <IglooServiceEvents.IglooLayoutUpdated> successHandler = null; successHandler = delegate { Service.Get <EventDispatcher>().RemoveListener(successHandler); onSyncStopped.InvokeSafe(); return(false); }; Service.Get <EventDispatcher>().AddListener(successHandler); IIglooUpdateLayoutErrorHandlerWrapper errorHandler2 = new IIglooUpdateLayoutErrorHandlerWrapper(successHandler, errorHandler); Service.Get <INetworkServicesManager>().IglooService.UpdateIglooLayout(item.LayoutId, mutableSceneLayout, errorHandler2); sceneLayoutDataModified[item] = false; flag = true; } if (!flag) { onSyncStopped.InvokeSafe(); } }
private ExtraLayoutInfo loadSittingLocations() { RuntimeSittingLocationsExporter runtimeSittingLocationsExporter = new RuntimeSittingLocationsExporter(); IList <ExportedSittingLocation> objectToSerialize = runtimeSittingLocationsExporter.ExportCurrentScene(); string value = Service.Get <JsonService>().Serialize(objectToSerialize); ExtraLayoutInfo extraLayoutInfo = new ExtraLayoutInfo(); extraLayoutInfo.Key = "SittingLocations"; extraLayoutInfo.Value = value; return(extraLayoutInfo); }