示例#1
0
 public float GetValue(bool forceRefresh)
 {
     if (forceRefresh)
     {
         this._value = NativeOptions.GetConfig(this.Type);
     }
     return(this._value);
 }
        public void CreateOptionsFile_NewSentryOptions_FileCreated()
        {
            const string testOptionsFileName = "testOptions.m";
            var          nativeOptions       = new NativeOptions();

            nativeOptions.CreateFile(testOptionsFileName, new SentryOptions());

            Assert.IsTrue(File.Exists(testOptionsFileName));

            File.Delete(testOptionsFileName);
        }
        public void GenerateOptions_NewSentryOptions_Compiles()
        {
            if (Application.platform != RuntimePlatform.OSXEditor)
            {
                Assert.Inconclusive("Skipping: Not on macOS");
            }

            const string testOptionsFileName = "testOptions.m";
            var          nativeOptions       = new NativeOptions();
            var          nativeOptionsString = nativeOptions.Generate(new SentryOptions());

            File.WriteAllText(testOptionsFileName, nativeOptionsString);

            var process = Process.Start("clang", $"-fsyntax-only {testOptionsFileName}");

            process.WaitForExit();

            Assert.AreEqual(0, process.ExitCode);

            File.Delete(testOptionsFileName);
        }
示例#4
0
 public void InitializeOptions()
 {
     this.SendMeBloodEvents = BannerlordConfig.ShowBlood;
     this.SendMeSoundEvents = (double)NativeOptions.GetConfig(NativeOptions.NativeOptionsType.SoundVolume) > 0.00999999977648258 && (double)NativeOptions.GetConfig(NativeOptions.NativeOptionsType.MasterVolume) > 0.00999999977648258;
 }
示例#5
0
 public void Commit() => NativeOptions.SetConfig(this.Type, this._value);
示例#6
0
 public virtual float GetDefaultValue() => NativeOptions.GetDefaultConfig(this.Type);
示例#7
0
 protected NativeOptionData(NativeOptions.NativeOptionsType type)
 {
     this.Type   = type;
     this._value = NativeOptions.GetConfig(type);
 }