private void SetupFairing() { // If we are duplicating in the editor, there will be some leftovers // Easier to just get rid of them rather than try to rebuild the hierarchy GameObject oldFairing = part.FindModelTransform(FAIRING_ROOT_TRANSFORM_NAME)?.gameObject; if (oldFairing != null) { Destroy(oldFairing); } GameObject fairingRootGO = new GameObject(FAIRING_ROOT_TRANSFORM_NAME); FairingRootTransform = fairingRootGO.transform; FairingRootTransform.NestToParent(ModelRootTransform); slices.Clear(); for (int i = 0; i < numSlices; i++) { slices.Add(new FairingSlice(this, i)); } UpdateSegments(); UpdateTransparency(); UpdateCargoBay(); part.ModifyCoM(); }
private void IgnoreColliders() { CollisionManager.IgnoreCollidersOnVessel(vessel, FairingRootTransform.GetComponentsInChildren <Collider>()); }