private void SetupIGeometryUpdaters()
        {
            geometryUpdaters = new List <IGeometryUpdater>();
            if (part is CompoundPart)
            {
                CompoundPartGeoUpdater compoundUpdate = new CompoundPartGeoUpdater((CompoundPart)part, this);
                geometryUpdaters.Add(compoundUpdate);
            }
            if (part.Modules.Contains("ModuleProceduralFairing"))
            {
                ModuleProceduralFairing[] fairings = part.GetComponents <ModuleProceduralFairing>();
                for (int i = 0; i < fairings.Length; i++)
                {
                    ModuleProceduralFairing fairing = fairings[i];

                    StockProcFairingGeoUpdater fairingUpdater = new StockProcFairingGeoUpdater(fairing, this);
                    geometryUpdaters.Add(fairingUpdater);
                }
            }
            if (part.Modules.Contains("ModuleJettison"))
            {
                ModuleJettison[] engineFairings = part.GetComponents <ModuleJettison>();
                for (int i = 0; i < engineFairings.Length; i++)
                {
                    ModuleJettison engineFairing = engineFairings[i];

                    StockJettisonTransformGeoUpdater fairingUpdater = new StockJettisonTransformGeoUpdater(engineFairing, this);
                    geometryUpdaters.Add(fairingUpdater);
                }
            }
        }
        private void SetupIGeometryUpdaters()
        {
            geometryUpdaters = new List<IGeometryUpdater>();
            if(part is CompoundPart)
            {
                CompoundPartGeoUpdater compoundUpdate = new CompoundPartGeoUpdater((CompoundPart)part, this);
                geometryUpdaters.Add(compoundUpdate);
            }
            if(part.Modules.Contains<ModuleProceduralFairing>())
            {
                List<ModuleProceduralFairing> fairings = part.Modules.GetModules<ModuleProceduralFairing>();
                for (int i = 0; i < fairings.Count; ++i)
                {
                    ModuleProceduralFairing fairing = fairings[i];

                    StockProcFairingGeoUpdater fairingUpdater = new StockProcFairingGeoUpdater(fairing, this);
                    geometryUpdaters.Add(fairingUpdater);
                }
            }
            if(part.Modules.Contains<ModuleJettison>())
            {
                List<ModuleJettison> engineFairings = part.Modules.GetModules<ModuleJettison>();
                for (int i = 0; i < engineFairings.Count; ++i)
                {
                    ModuleJettison engineFairing = engineFairings[i];

                    StockJettisonTransformGeoUpdater fairingUpdater = new StockJettisonTransformGeoUpdater(engineFairing, this);
                    geometryUpdaters.Add(fairingUpdater);
                }
            }
            if (part.Modules.Contains<ModuleAsteroid>())
            {
                ModuleAsteroid asteroidModule = part.Modules.GetModule<ModuleAsteroid>();

                StockProcAsteroidGeoUpdater asteroidUpdater = new StockProcAsteroidGeoUpdater(asteroidModule, this);
                geometryUpdaters.Add(asteroidUpdater);
                
            }
        }
Ejemplo n.º 3
0
        private void SetupIGeometryUpdaters()
        {
            geometryUpdaters = new List <IGeometryUpdater>();
            if (part is CompoundPart compoundPart)
            {
                var compoundUpdate = new CompoundPartGeoUpdater(compoundPart, this);
                geometryUpdaters.Add(compoundUpdate);
            }

            if (part.Modules.Contains <ModuleProceduralFairing>())
            {
                List <ModuleProceduralFairing> fairings = part.Modules.GetModules <ModuleProceduralFairing>();
                foreach (ModuleProceduralFairing fairing in fairings)
                {
                    var fairingUpdater = new StockProcFairingGeoUpdater(fairing, this);
                    geometryUpdaters.Add(fairingUpdater);
                }
            }

            if (part.Modules.Contains <ModuleJettison>())

            {
                List <ModuleJettison> engineFairings = part.Modules.GetModules <ModuleJettison>();
                foreach (ModuleJettison engineFairing in engineFairings)
                {
                    var fairingUpdater = new StockJettisonTransformGeoUpdater(engineFairing, this);
                    geometryUpdaters.Add(fairingUpdater);
                }
            }

            if (!part.Modules.Contains <ModuleAsteroid>())
            {
                return;
            }
            var asteroidUpdater = new StockProcAsteroidGeoUpdater(this);

            geometryUpdaters.Add(asteroidUpdater);
        }