/// <summary> /// Manually trigger a load operation for the WorldLocking state /// </summary> public void Load() { #if UNITY_WSA /// Persistence currently only supported on HoloLens WrapErrors(loadAsync()); alignmentManager.Load(); #endif // UNITY_WSA }
/// <summary> /// Manually trigger a load operation for the WorldLocking state /// </summary> public void Load() { if (shared.anchorSettings.anchorSubsystem == AnchorSettings.AnchorSubsystem.WSA) { /// Persistence currently only supported on HoloLens Legacy WrapErrors(loadAsync()); alignmentManager.Load(); } }
/// <summary> /// Manually trigger a load operation for the WorldLocking state /// </summary> public void Load() { WrapErrors(loadAsync()); alignmentManager.Load(); }
public IEnumerator SaveLoadTestSaveThenLoad() { GameObject rig = loadHelper.LoadBasicSceneRig(); WorldLockingManager wltMgr = WorldLockingManager.GetInstance(); var settings = wltMgr.Settings; settings.AutoLoad = false; settings.AutoSave = false; wltMgr.Settings = settings; IAlignmentManager alignMgr = wltMgr.AlignmentManager; alignMgr.ClearAlignmentAnchors(); alignMgr.SendAlignmentAnchors(); // Verify alignment is identity VerifyAlignmentIdentity(alignMgr, pinData); // Add pins for (int i = 0; i < pinData.Length; ++i) { pinData[i].anchorId = alignMgr.AddAlignmentAnchor(pinData[i].name, pinData[i].virtualPose, pinData[i].lockedPose); } alignMgr.SendAlignmentAnchors(); yield return(null); // Verify alignment at pins VerifyAlignment(alignMgr, pinData); // Save alignMgr.Save(); yield return(null); // Verify alignment at pins, saving should be non-destructive. VerifyAlignment(alignMgr, pinData); // Clear alignMgr.ClearAlignmentAnchors(); alignMgr.SendAlignmentAnchors(); yield return(null); // Verify alignment is identity VerifyAlignmentIdentity(alignMgr, pinData); // Load alignMgr.Load(); yield return(null); for (int i = 0; i < pinData.Length; ++i) { pinData[i].anchorId = alignMgr.RestoreAlignmentAnchor(pinData[i].name, pinData[i].virtualPose); } alignMgr.SendAlignmentAnchors(); yield return(null); // Verify alignment at pins, load should have restored them. VerifyAlignment(alignMgr, pinData); GameObject.Destroy(rig); yield return(null); }