// Update is called once per frame void Update() { //Progress Seasons if (GameManager.instance.dialogStage >= (int)DialogueStages.ActivatedSpring) { PanelSpring.SetActive(true); } if (GameManager.instance.dialogStage >= (int)DialogueStages.ActivatedSummer) { PanelSummer.SetActive(true); } if (GameManager.instance.dialogStage >= (int)DialogueStages.ActivatedAutumn) { PanelAutumn.SetActive(true); } if (GameManager.instance.dialogStage >= (int)DialogueStages.ActivatedWinter) { PanelWinter.SetActive(true); } //ProgressBar if (bioMatterHub.bioMatter >= 100) { ProgressBar1.SetActive(true); } else { ProgressBar1.SetActive(false); } if (bioMatterHub.bioMatter >= 200) { ProgressBar2.SetActive(true); } else { ProgressBar2.SetActive(false); } if (bioMatterHub.bioMatter >= 300) { ProgressBar3.SetActive(true); } else { ProgressBar3.SetActive(false); } if (bioMatterHub.bioMatter >= 400) { ProgressBar4.SetActive(true); } else { ProgressBar4.SetActive(false); } if (bioMatterHub.bioMatter >= 500) { ProgressBar5.SetActive(true); if (GameManager.instance.dialogStage >= (int)DialogueStages.ActivatedWinter && !GameManager.instance.gameIsOver) { GameManager.instance.dialogue.endGame(); GameManager.instance.gameIsOver = true; } } else { ProgressBar5.SetActive(false); } }
public void startrun3() { OnRun++; sd3.Visibility = System.Windows.Visibility.Visible; sp3.Visibility = System.Windows.Visibility.Visible; this.Height += 74; ProcessStartInfo startUWG = new ProcessStartInfo(); //startUWG.FileName = "C:\\Users\\anakano\\Documents\\Research\\UWG2.1\\For_Installer\\UWGv2.0.exe"; startUWG.FileName = "UWGEngine.exe"; //make sure there is space in between each of the four inputs and that folder extension ends with \\ startUWG.Arguments = ep + "\\ " + ef3 + " " + xp3 + "\\ " + xf3 + " " + rp + "\\ " + rf3 + " " + mon + " " + day + " " + dur; //startUWG.Arguments = this.epwPath + this.epwFileName + this.xmlPath + this.xmlFilename; startUWG.UseShellExecute = false; startUWG.CreateNoWindow = true; startUWG.RedirectStandardOutput = true; double maxx = System.Convert.ToDouble(dur); ProgressBar3.Maximum = System.Convert.ToDouble(dur); UWGs3 = Process.Start(startUWG); UWGst3 = 1; UWGs3.EnableRaisingEvents = true; UWGs3.Exited += new EventHandler(onClose); StreamReader UWGreader = UWGs3.StandardOutput; new Thread(() => { String UWGreaderst; int value = 0; while (!UWGreader.EndOfStream) { UWGreaderst = UWGreader.ReadLine(); this.Dispatcher.Invoke(new Action(() => { if (UWGreaderst == "le") { ProgressBar3.IsIndeterminate = false; RunningInfo3.Text = "Loading EPW file..."; DoubleAnimation ani = new DoubleAnimation(maxx, TimeSpan.FromSeconds(15)); ProgressBar3.BeginAnimation(ProgressBar.ValueProperty, ani); } if (UWGreaderst == "lx") { RunningInfo3.Text = "Loading XML file..."; DoubleAnimation ani1 = new DoubleAnimation(0, TimeSpan.FromSeconds(0)); ProgressBar3.BeginAnimation(ProgressBar.ValueProperty, ani1); DoubleAnimation ani2 = new DoubleAnimation(maxx, TimeSpan.FromSeconds(15)); ProgressBar3.BeginAnimation(ProgressBar.ValueProperty, ani2); } if (UWGreaderst == "start") { DoubleAnimation ani1 = new DoubleAnimation(0, TimeSpan.FromSeconds(0)); ProgressBar3.BeginAnimation(ProgressBar.ValueProperty, ani1); ProgressBar3.Value = 0; RunningInfo3.Text = "Generating Day " + System.Convert.ToString(1) + "..."; } if (UWGreaderst == "+") { value++; ProgressBar3.Visibility = System.Windows.Visibility.Visible; // ProgressBar.Value = value; DoubleAnimation ani = new DoubleAnimation(value, TimeSpan.FromSeconds(.5)); ProgressBar3.BeginAnimation(ProgressBar.ValueProperty, ani); if (value == System.Convert.ToDouble(dur)) { value = value - 1; } RunningInfo3.Text = "Generating Day " + System.Convert.ToString(value + 1) + "..."; } if (UWGreaderst == "end") { RunningInfo3.Text = "Writing new EPW file"; } if (UWGreaderst == "over") { UWGst3 = 0; RunningInfo3.Text = "Generating finished!"; System.IO.File.Delete(System.IO.Path.Combine(ep, ef3)); } })); } }).Start(); }