コード例 #1
0
        private void Update()
        {
            try
            {
                timeSinceLastCheck += Time.deltaTime;
                if (timeSinceLastCheck >= checkFrequency)
                {
                    timeSinceLastCheck -= checkFrequency;

                    boolValues["prefsSoftPhysics"]  = UserPreferences.singleton.softPhysics;
                    boolValues["bodySoftPhysics"]   = softBodyPhysicsEnabler.GetBoolParamValue("enabled");
                    boolValues["breastSoftPhysics"] = Globals.BREAST_PHYSICS_MESH.on;

                    //In/Out morphs can become enabled by e.g. loading an appearance preset. Force off.
                    if (breastInOut.GetBoolParamValue("enabled"))
                    {
                        breastInOut.SetBoolParamValue("enabled", false);
                        Log.Message("Auto Breast In/Out Morphs disabled - this plugin adjusts breast morphs better without it.");
                    }

                    bool fullUpdateNeeded = false;
                    foreach (KeyValuePair <string, bool> kvp in boolValues)
                    {
                        fullUpdateNeeded = CheckBoolValue(kvp.Key, kvp.Value);
                    }

                    if (fullUpdateNeeded)
                    {
                        StartCoroutine(gameObject.GetComponent <Script>().RefreshStaticPhysics());
                    }

                    float fixedDeltaTime = Time.fixedDeltaTime;
                    if (fixedDeltaTime != prevFixedDeltaTime)
                    {
                        gameObject.GetComponent <Script>().RefreshRateDependentPhysics();
                    }
                    prevFixedDeltaTime = fixedDeltaTime;
                }
            }
            catch (Exception e)
            {
                Log.Error($"{e}", nameof(SettingsMonitor));
                enabled = false;
            }
        }