public void MakeAllDisconnectedPartsGhosty() { if (currCraft == null) { return; } //update structure currCraft.UpdatePhysParts(true); List <PhysPart> connectedParts = new List <PhysPart>(PartConnection.GetConnectedParts(currCraft.originPart)); foreach (PhysPart part in currCraft.Parts) { if (connectedParts.Contains(part)) { if (currPart == null || PartConnection.IsConnectedToPartIgnoringInvalidParts(part, currCraft.originPart, new PhysPart[1] { currPart })) //Check if part is connected to origin, IGNORING held part. { MakePartGhosty(part, false); } } else { MakePartGhosty(part, true); } } }
public CraftBlueprint GetBlueprintFromCurrCraft() { //ignore held part if (currPart != null) { currPart.transform.SetParent(null); currPart.DestroyPartLite(); } MultipartPhysBody physBody = currCraft.GetComponent <MultipartPhysBody>(); physBody.UpdatePhysParts(true); foreach (PhysPart p in physBody.Parts) { p.connections = CalculatePartConnections(p); } return(CraftBlueprint.GetBlueprintFromCraft(physBody)); }