/// <summary>
        /// Add an anchor graph visualization to the scene if it doesn't already have one.
        /// </summary>
        /// <param name="wltRoot">The root object to attach the visualization to.</param>
        private static void AddAnchorVisualizer(Transform wltRoot)
        {
            AnchorGraphVisual anchorVisual = GameObject.FindObjectOfType <AnchorGraphVisual>();

            if (anchorVisual == null)
            {
                GameObject anchorVisualObject = InstantiatePrefab("WorldLocking.Tools/Prefabs", "AnchorGraphVisual");
                anchorVisual = anchorVisualObject.GetComponent <AnchorGraphVisual>();
            }
            Debug.Assert(anchorVisual != null, "Missing AnchorGraphVisual prefab?");
            anchorVisual.transform.parent = wltRoot;
        }
コード例 #2
0
 /// <summary>
 /// Constructor takes the owning AnchorGraphVisual and a list of
 /// FrozenAnchorVisuals as resources.
 /// </summary>
 /// <remarks>The visuals must be sorted for fast lookup of the endpoints.</remarks>
 /// <param name="owner">The owning component.</param>
 /// <param name="frozenResources">The *sorted* list of FrozenAnchorVisuals.</param>
 public FrozenEdgeVisualCreator(AnchorGraphVisual owner, List <IdPair <AnchorId, FrozenAnchorVisual> > frozenResources)
 {
     this.owner           = owner;
     this.frozenResources = frozenResources;
 }