コード例 #1
0
        public static void UpdateRanges(bool updatingFromUi = false)
        {
            Debug.Log("[PhysicsRangeExtender]:  Updating ranges");
            FloatingOrigin.fetch.threshold = Mathf.Pow(PreSettings.GlobalRange * 1000 * 1.20f, 2);

            if (updatingFromUi)
            {
                TerrainExtender.UpdateSphere();
            }

            _globalSituation = new VesselRanges.Situation(
                PreSettings.GlobalRange * 1000,
                PreSettings.GlobalRange * 1000 * 1.05f,
                PreSettings.GlobalRange * 1000 * 1.10f,
                PreSettings.GlobalRange * 1000 * 0.99f);

            _baseRanges = new VesselRanges
            {
                escaping   = _globalSituation,
                flying     = _globalSituation,
                landed     = _globalSituation,
                orbit      = _globalSituation,
                prelaunch  = _globalSituation,
                splashed   = _globalSituation,
                subOrbital = _globalSituation
            };
            ApplyRangesToVessels(updatingFromUi);
        }
コード例 #2
0
        private void Start()
        {
            if (!PreSettings.ConfigLoaded)
            {
                return;
            }
            if (!PreSettings.ModEnabled)
            {
                return;
            }

            TerrainExtender.UpdateSphere();
            UpdateRanges();

            GameEvents.onVesselCreate.Add(ApplyPhysRange);
            GameEvents.onVesselLoaded.Add(ApplyPhysRangeOnLoad);
            GameEvents.onVesselSwitching.Add(ApplyPhysRange);
            GameEvents.onVesselGoOffRails.Add(ApplyPhysRange);
            GameEvents.onVesselSituationChange.Add(SituationChangeFixes);
        }