示例#1
0
        // Updates child pWings
        public void UpdateChildren()
        {
            // Get the list of child parts
            foreach (Part p in part.children)
            {
                // Check that it is a pWing and that it is affected by parent snapping
                WingManipulator wing = p.Modules.GetModule <WingManipulator>();
                if (wing != null && !wing.IgnoreSnapping && !wing.doNotParticipateInParentSnapping)
                {
                    // Update its positions and refresh the collider
                    wing.UpdatePositions();
                    wing.SetupCollider();

                    // If its a wing, refresh its aerodynamic values
                    wing.CalculateAerodynamicValues();
                }
            }
        }
示例#2
0
        public void UpdateAllCopies(bool childrenNeedUpdate)
        {
            UpdatePositions();
            SetupCollider();

            if (updateChildren && childrenNeedUpdate)
            {
                UpdateChildren();
            }

            CalculateAerodynamicValues();

            foreach (Part p in part.symmetryCounterparts)
            {
                if (p == null)
                {
                    continue;
                }
                WingManipulator clone = p.Modules.GetModule <WingManipulator>();

                clone.rootScale   = rootScale;
                clone.tipScale    = tipScale;
                clone.tipPosition = tipPosition;

                clone.relativeThicknessScaling = relativeThicknessScaling;
                //clone.SetThicknessScalingEventName();

                clone.UpdatePositions();
                clone.SetupCollider();

                if (updateChildren && childrenNeedUpdate)
                {
                    clone.UpdateChildren();
                }

                clone.CalculateAerodynamicValues();
            }
        }