bool WeldParts(GrabbablePart startPart, GrabbablePart endPart, Vector3 startPoint, Vector3 endPoint) { ClearSelections(); // TODO // Debug.Log("WeldParts "+startPart+" -> "+endPart+" "+startPoint+" "+endPoint); if (endPart == null) { return(false); } HexMetrics.Direction direction; Adjancency adjacency = IsAdjacent(startPart, endPart, out direction); if (adjacency == Adjancency.Adjacent) { startPart.ConnectPartAndPlaceAtRelativeDirection(endPart, GrabbablePart.PhysicalConnectionType.Weld, (HexMetrics.Direction)direction); } else if (adjacency == Adjancency.Connected) { // startPart.SetPhysicalConnection( PerformsConstructionFunctionThatMightSplit((con) => startPart.SetPhysicalConnection(direction, GrabbablePart.PhysicalConnectionType.None, GrabbablePart.SplitOptions.SplitIfNecessary)); } return(true); }
bool DrawGhostWeld(GrabbablePart startPart, GrabbablePart overPart, Vector3 startPoint, Vector3 thisPoint) { ClearSelections(); // TODO // Debug.Log("DrawGhostWeld "+startPart+" -> "+overPart+" "+startPoint+" "+thisPoint); if (overPart == null) { return(false); } HexMetrics.Direction direction; Adjancency adjacency = IsAdjacent(startPart, overPart, out direction); if (adjacency != Adjancency.None) { startPart.highlighted = true; overPart.highlighted = true; } return(false); }