コード例 #1
0
 void Update()
 {
     // detect position of A and snag into head of A
     if (headA != null && !headA.Equals(null) && anchorA != null)
     {
         headA.position = _anchorATransform.position;
         var realAnchoredPositionA = ComputeRealAnchoredPosition(_rectA, _rectParentA, anchorA.pinType);
         lineRenderer.Points[0] = realAnchoredPositionA;
     }
     // detect position of B and snag into head of B
     if (headB != null && !headB.Equals(null) && anchorB != null)
     {
         headB.position = _anchorBTransform.position;
         var realAnchoredPositionB = ComputeRealAnchoredPosition(_rectB, _rectParentB, anchorB.pinType);
         lineRenderer.Points[1] = realAnchoredPositionB;
     }
     lineRenderer.OnRebuildRequested();
     // updating remove button position
     UpdateRemoveButtonPosition();
 }