private void CreateTransform() { topEdge = new GameObject().transform; topEdge.localScale = new Vector3(1.0f, 0.05f, 1.0f); topEdge.up = -1 * transform.right; topEdge.parent = transform; widget = CreateTransformWidget(topEdge); widget.transform.position = transform.position + (topEdge.up * 0.25f); }
private void MoveOnAxis(Vector3 initialPosition, Vector3 currentPosition, Vector3 moveAxis) { var dragDelta = initialPosition + Vector3.Project(currentPosition - lastClickHitInfo.point, moveAxis); if (CanDragPredicate == null || CanDragPredicate.Invoke(transform.position, Vector3.Project(currentPosition - lastClickHitInfo.point, moveAxis))) { if (snap) { dragDelta = TransformWidget.Snap(dragDelta); } RootWidget.transform.position = dragDelta; if (OnDragging != null) { OnDragging.Invoke(); } } }