Exemplo n.º 1
0
    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);
            }
        }
    }
Exemplo n.º 2
0
    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));
    }