private void FindAlignmentManager() { AlignSubtree subTree = targetSubtree; if (subTree != null) { FindAlignmentManagerFromSubtree(subTree); } else { SetAlignmentManager(WorldLockingManager.GetInstance().AlignmentManager); } }
private void FindAlignmentManagerFromSubtree(AlignSubtree subTree) { Debug.Assert(subTree != null, "Trying to find alignment manager from null subTree."); if (subTree.AlignmentManager == null) { subTree.OnAlignManagerCreated += (sender, manager) => { SetAlignmentManager(manager); }; } else { SetAlignmentManager(subTree.AlignmentManager); } }
private void Awake() { AlignSubtree subTree = FindObjectOfType <AlignSubtree>(); if (subTree != null) { if (subTree.AlignmentManager == null) { subTree.OnAlignManagerCreated += (sender, manager) => { this.alignmentManager = manager; alignmentManager.OnTriangulationBuilt += OnNewTriangulationWasBuilt; }; } else { this.alignmentManager = subTree.AlignmentManager; alignmentManager.OnTriangulationBuilt += OnNewTriangulationWasBuilt; } } }