private async void simpleButton1_Click(object sender, EventArgs e) { if (Sounding?.InnerList?.Count == 0) { XtraMessageBox.Show(_localization.LoadText(1061), _localization.LoadText(1037), MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } Sounding.UpdateData(true, true, false, 5); var serializedJson = JsonConvert.SerializeObject(Sounding.InnerList); string fileName = Path.Combine(Path.GetTempFileName()); using (StreamWriter myWriter = File.CreateText(fileName)) { myWriter.WriteLine(serializedJson); } if (File.Exists(fileName)) { SplashScreenManager.ShowForm(this, typeof(ProgressControl), true, true); SplashScreenManager.Default.SetWaitFormCaption(_localization.LoadText(3700)); FireBase.SetProgress += (s, arg) => SplashScreenManager.Default.SetWaitFormDescription(_localization.LoadText(1062) + ": " + arg + "% " + _localization.LoadText(1063)); await FireBase.AddFlight(fileName, StationId, Sounding.StartTime, Temp100FileName, TempEndFileName); SplashScreenManager.CloseForm(false); } }
public void Play(string sound) { Sounding s = Array.Find(sounds, audio => audio.name == sound); if (s == null) { Debug.LogWarning("Sound: " + sound + " not found!"); return; } else { s.source.volume = s.volume; // * (1f + UnityEngine.Random.Range(-s.volumeVariance / 2f, s.volumeVariance / 2f)); s.source.pitch = s.pitch; // * (1f + UnityEngine.Random.Range(-s.pitchVariance / 2f, s.pitchVariance / 2f)); s.source.Play(); } }