private WorldLockingManager() { CreateUpdaterNode(); /// It might look nicer to pull these off into internal setup functions, /// but by leaving them in the constructor, these fields can be marked "readonly", /// which they conceptually are. if (Core.Plugin.HasEngine()) { Plugin = new Plugin(); } else { Plugin = new PluginNoop(); } DiagnosticRecordings.Start(Plugin); headPoseTracker = new HeadPoseTrackerCamera(); /// This should never fail. It's a null-manager. anchorManager = AnchorManagerNull.TryCreate(Plugin, headPoseTracker); Debug.Assert(anchorManager != null, "Null manager creation should never fail"); var fm = new FragmentManager(Plugin); fragmentManager = fm; attachmentPointManager = fm; /// Note the alignmentManager accesses the FragmentManager in its constructor /// to register for refit notifications. Either FragmentManager needs to be fully /// setup before constructing AlignmentManager, or that registration needs to be deferred. alignmentManager = new AlignmentManager(this); }
/// <summary> /// Perform any initialization only appropriate once. This is called after /// giving the caller a chance to change settings. /// </summary> private void OneTimeStartUp() { anchorManager = SelectAnchorManager(Plugin, headPoseTracker); if (AutoLoad) { Load(); } else { Reset(); } hasBeenStarted = true; }
/// <summary> /// Perform any initialization only appropriate once. This is called after /// giving the caller a chance to change settings. /// </summary> public async void ResetAnchorManager() { initializationState = InitializationState.Starting; anchorManager = await SelectAnchorManager(Plugin, headPoseTracker); if (AutoLoad) { Load(); } else { Reset(); } initializationState = InitializationState.Running; }
private WorldLockingManager() { CreateUpdaterNode(); /// It might look nicer to pull these off into internal setup functions, /// but by leaving them in the constructor, these fields can be marked "readonly", /// which they conceptually are. Plugin = new Plugin(); DiagnosticRecordings.Start(Plugin); var am = new AnchorManager(Plugin); anchorManager = am; var fm = new FragmentManager(Plugin); fragmentManager = fm; attachmentPointManager = fm; /// Note the alignmentManager accesses the FragmentManager in its constructor /// to register for refit notifications. Either FragmentManager needs to be fully /// setup before constructing AlignmentManager, or that registration needs to be deferred. alignmentManager = new AlignmentManager(this); }
static AnchorManager() { ChatServer.Instance.UpdateManager.InitStaticImpl(typeof(AnchorManager), typeof(AnchorManagerDefaultImpl), o => { mImpl = (IAnchorManager)o; }); }