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(); } } } }
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(); } } }