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); }
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; }
public void Commit() => NativeOptions.SetConfig(this.Type, this._value);
public virtual float GetDefaultValue() => NativeOptions.GetDefaultConfig(this.Type);
protected NativeOptionData(NativeOptions.NativeOptionsType type) { this.Type = type; this._value = NativeOptions.GetConfig(type); }