예제 #1
0
        private void LEGACY_UpdateWingAeroModels(bool updateWingInteractions)
        {
            List <Part> partsList = EditorLogic.SortedShipList;

            _wingAerodynamicModel.Clear();
            for (int i = 0; i < partsList.Count; i++)
            {
                Part p = partsList[i];
                if (p != null)
                {
                    if (p.Modules.Contains <FARWingAerodynamicModel>())
                    {
                        FARWingAerodynamicModel w = p.Modules.GetModule <FARWingAerodynamicModel>();
                        if (updateWingInteractions)
                        {
                            w.EditorUpdateWingInteractions();
                        }
                        _wingAerodynamicModel.Add(w);
                    }
                    else if (p.Modules.Contains <FARControllableSurface>())
                    {
                        FARControllableSurface c = p.Modules.GetModule <FARControllableSurface>();
                        if (updateWingInteractions)
                        {
                            c.EditorUpdateWingInteractions();
                        }
                        _wingAerodynamicModel.Add(c);
                    }
                }
            }
        }
예제 #2
0
        private void LEGACY_UpdateWingAeroModels(bool updateWingInteractions)
        {
            List <Part> partsList = EditorLogic.SortedShipList;

            _wingAerodynamicModel.Clear();
            foreach (Part p in partsList)
            {
                if (p == null)
                {
                    continue;
                }
                if (p.Modules.Contains <FARWingAerodynamicModel>())
                {
                    FARWingAerodynamicModel w = p.Modules.GetModule <FARWingAerodynamicModel>();
                    if (updateWingInteractions)
                    {
                        w.EditorUpdateWingInteractions();
                    }
                    _wingAerodynamicModel.Add(w);
                }
                else if (p.Modules.Contains <FARControllableSurface>())
                {
                    FARControllableSurface c = p.Modules.GetModule <FARControllableSurface>();
                    if (updateWingInteractions)
                    {
                        c.EditorUpdateWingInteractions();
                    }
                    _wingAerodynamicModel.Add(c);
                }
            }
        }
예제 #3
0
        private void UpdateWingInteractionsPart(ConstructionEventType type, Part p)
        {
            EditorPartsChanged = true;
            FARWingAerodynamicModel w = p.GetComponent <FARWingAerodynamicModel>();

            if ((object)w != null)
            {
                if (type == ConstructionEventType.PartAttached)
                {
                    w.OnWingAttach();
                }
                else if (type == ConstructionEventType.PartDetached)
                {
                    w.OnWingDetach();
                }
                w.EditorUpdateWingInteractions();
            }
        }