Exemplo n.º 1
0
    public IEnumerator AwaitConfig()
    {
        for (;;)
        {
            if (Config._instance != null)
            {
                if (!Serialization.ReadConfig())
                {
                    ApplyDefaultConfig();
                }
                else
                {
                    defaultCoroutineTiming = Config.Settings.coroutineTiming;
                }

                if (!Serialization.ReadNoiseConfig())
                {
                    NoiseConfig.ApplyDefaults();
                }

                setOptions.SetResolution(Config.Settings.resolution);
                Config.QualityLevel = Config.QualityLevel;
                Config.WorldSize    = Config.Settings.worldSize;
                setOptions.SetMusicLevel(Config.MusicVolume * 0.01f);
                setOptions.SetSfxLevel(Config.SfxVolume * 0.01f);
                break;
            }
            else
            {
                yield return(null);
            }
        }
    }