コード例 #1
0
    public void SideSeparator()
    {
        Part part  = CreateRocket.CreatePart(this.leftHalfPrefab, this.part.orientation, this.part.transform.parent, this.part.transform.localPosition);
        Part part2 = CreateRocket.CreatePart(this.rightHalfPrefab, this.part.orientation, this.part.transform.parent, this.part.transform.localPosition);

        SeparatorModule.TransferJoints(this.part, 0, part, 0);
        SeparatorModule.TransferJoints(this.part, 1, part2, 0);
        this.part.vessel.partsManager.parts.Add(part);
        this.part.vessel.partsManager.parts.Add(part2);
        this.part.vessel.partsManager.UpdatePartsGruping(true, this.part.vessel);
        part.UsePart();
        part2.UsePart();
        this.part.DestroyPart(false, true);
    }
コード例 #2
0
 public void SplitFairing(ref List <Part> partsToPush)
 {
     if (this.fairingHalfPrefab != null)
     {
         Part part  = CreateRocket.CreatePart(this.fairingHalfPrefab, this.part.orientation, this.part.transform.parent, this.part.transform.localPosition);
         Part part2 = CreateRocket.CreatePart(this.fairingHalfPrefab, new Orientation(-this.part.orientation.x, this.part.orientation.y, this.part.orientation.z), this.part.transform.parent, this.part.transform.localPosition);
         part2.transform.GetChild(1).gameObject.SetActive(false);
         part2.transform.GetChild(2).gameObject.SetActive(true);
         for (int i = 0; i < this.leftJoints.Length; i++)
         {
             SeparatorModule.TransferJoints(this.part, this.leftJoints[i], part, 0);
         }
         for (int j = 0; j < this.rightJoints.Length; j++)
         {
             SeparatorModule.TransferJoints(this.part, this.rightJoints[j], part2, 0);
         }
         this.part.vessel.partsManager.parts.Add(part);
         this.part.vessel.partsManager.parts.Add(part2);
         partsToPush.Add(part);
         partsToPush.Add(part2);
     }
     this.part.DestroyPart(false, true);
 }