예제 #1
0
 private void hideAllExternalPopups()
 {
     if (HighLogic.LoadedSceneIsFlight)
     {
         foreach (Part p in vessel.parts)
         {
             if (p != part)
             {
                 FSVTOLrotator vtol = p.GetComponent <FSVTOLrotator>();
                 if (vtol != null)
                 {
                     if (vtol.popup != null)
                     {
                         vtol.popup.showMenu = false;
                     }
                 }
             }
         }
     }
 }
예제 #2
0
        public void testUseAngle()
        {
            buildAngleList();
            List <Part> vtolParts = new List <Part>(part.symmetryCounterparts);

            vtolParts.Add(part);
            foreach (Part p in vtolParts)
            {
                FSVTOLrotator vtol = p.GetComponent <FSVTOLrotator>();
                if (vtol != null)
                {
                    vtol.targetAngle = availableAnglesList[selectedListAngle];
                    float dot = Vector3.Dot(vtol.partTransform.position.normalized, Vector3.right);
                    if (dot < 0) // check for orientation of the part, relative to world directions, since there is no vessel transfrom to compare to
                    {
                        vtol.targetAngle *= -1;
                    }

                    vtol.partTransform.transform.localEulerAngles = new Vector3(-vtol.targetAngle, 0f, 0f);
                }
            }
        }
예제 #3
0
        private void updateSteeringSetup(bool pitch, bool yaw, bool roll, bool throttlePitch)
        {
            steerPitch         = pitch;
            steerYaw           = yaw;
            steerRoll          = roll;
            steerThrottlePitch = throttlePitch;

            foreach (Part p in part.symmetryCounterparts)
            {
                FSVTOLrotator vtol = p.GetComponent <FSVTOLrotator>();
                if (vtol != null)
                {
                    vtol.steerPitch         = pitch;
                    vtol.steerYaw           = yaw;
                    vtol.steerRoll          = roll;
                    vtol.steerThrottlePitch = throttlePitch;
                    vtol.VTOLSteeringMode   = this.VTOLSteeringMode;
                    vtol.isInFrontOfCoM     = this.isInFrontOfCoM;
                    vtol.updateButtonTexts();
                }
            }
            updateButtonTexts();
            hideAllExternalPopups();
        }