Esempio n. 1
0
 private new void Update()
 {
     base.Update();
     if (parentPoint != null)
     {
         interactable.enabled = !parentPoint.link.freezed;
     }
     if (showPreview)
     {
         prevPoint    = hoveredPoint;
         hoveredPoint = roomnet.GetPointHover(centerTransf.position);
         if (hoveredPoint != null && hoveredPoint.snapped == null && hoveredPoint.type == pointType)
         {
             if (!preview.activeInHierarchy)
             {
                 EnablePreview();
             }
             hoveredPoint.Snap(preview.transform, transform);
         }
         else
         {
             if (preview.activeInHierarchy)
             {
                 DisablePreview();
             }
         }
     }
 }
Esempio n. 2
0
 private void Start()
 {
     if (startSnapped)
     {
         hoveredPoint = roomnet.GetPointHover(centerTransf.position);
         if (hoveredPoint != null)
         {
             hoveredPoint.Snap(preview.transform, transform);
             transform.position    = preview.transform.position;
             transform.rotation    = preview.transform.rotation;
             rigidbody.isKinematic = true;
             Snapped();
         }
     }
 }