protected IEnumerator dead_Enter() { GetComponent <Animation>().CrossFade("dead", animChangeDuration, PlayMode.StopAll); GetComponent <Rigidbody>().velocity = Vector3.zero; GetComponent <Rigidbody>().angularVelocity = Vector3.zero; GetComponent <Collider>().enabled = false; GetComponent <Rigidbody>().useGravity = false; yield return(new WaitForSeconds(2f)); // Destroy(gameObject); if (!automatic) { if (GameData.Instance.DeadTime < 3) { GameData.Instance.DeadTime += 1; FuhuoDialog.PopUp(GameData.Instance.DeadTime); } else { Camera.main.GetComponent <GrayscaleEffect>().enabled = true; ResultDialog.Popup(false); } } // Application.LoadLevel("ui"); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { random = new Random(); // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); this.IsMouseVisible = true; //Global.Content = this.Content; Global.init(this.Content); Config.Instance.Load(); // TODO: use this.Content to load your game content here Global.WINDOW_WIDTH = GraphicsDevice.Viewport.Width; Global.WINDOW_HEIGHT = GraphicsDevice.Viewport.Height; subMenu = new SubMenu(this.GraphicsDevice); resultDialog = new ResultDialog(this.GraphicsDevice); confirmDialog = new ConfirmDialog(this.GraphicsDevice); annouceDialog = new AnnounceDialog(this.GraphicsDevice); inputDialog = new InputTextDialog(this.GraphicsDevice); menu = new Menu(); log = new MissionLog(); music = Global.loadSong(); collect = Global.loadSoundEffect("Collect-sound"); endGame = Global.loadSoundEffect("Game-Over"); Global.ghostSound = Global.loadSoundEffect("Ghost"); Global.zombieSound = Global.loadSoundEffect("Zombie"); //load(currentRow, currentCol, 2, 2, 2, 8); }
void Start () { data = GameObject.FindObjectOfType<ParkourData>(); if (!data) Debug.Log("ParkourData not Found!"); resultDialog = GameObject.FindObjectOfType<ResultDialog>(); if (!resultDialog) Debug.Log("ResultDialog not Found!"); }
private void MatchList_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e) { if (string.IsNullOrWhiteSpace(ReplaceTb.Text) || _regex == null) { return; } var template = ReplaceTb.Text; var dialog = new ResultDialog { Result = _regex.Compiler(template) }; _ = dialog.ShowAsync(); }
/// <summary> /// 倒计时 /// </summary> /// <param name="seconds">总时间</param> /// <returns></returns> public IEnumerator DoCountDown(int seconds) { while (isStop) { if (seconds - Time.timeSinceLevelLoad < 0) { StopCoroutine("DoCountDown"); ResultDialog.Popup(false); yield return(isStop = false); break; } UIBattleSceneLogic.Instance.TimeChange(Ultilities.ConvertSecondToTime((int)(seconds - Time.timeSinceLevelLoad))); yield return(new WaitForSeconds(1f)); } }
private void finish() { List <bool[]> useranswers = new List <bool[]>(); float total = 0; for (int i = 0; i < question_controls.Count; i++) { bool[] result = new bool[questions[i].answers.Count]; if (question_controls[i].getResult(result)) { total += questions[i].score; } useranswers.Add(result); } counterDown.Enabled = false; ResultDialog rd = new ResultDialog(questions, useranswers, total); rd.ShowDialog(); }
public void OnCancel() { DialogManager.Instance.CloseDialog(); Camera.main.GetComponent <GrayscaleEffect>().enabled = true; ResultDialog.Popup(false); }
IEnumerator PopUpResultDialog(bool success) { yield return(new WaitForSeconds(4f)); ResultDialog.Popup(success); }
private void Game_PropertyChanged(object sender, PropertyChangedEventArgs e) { switch (e.PropertyName) { case "RemainingBombs": this.RemainingMinesLabel.Text = Game.RemainingBombs.ToString(); if (Game.RemainingBombs == 0) { Game.RemainingItems++; Game.RemainingItems--; } break; case "GameOver": ResultDialog result = new ResultDialog(); result.Controls[result.Controls.IndexOf(result.ResultLabel)].Text = "Sorry, you lost the game!"; result.Controls[result.Controls.IndexOf(result.Time)].Text = TimeSeconds.ToString() + " seconds"; result.Controls[result.Controls.IndexOf(result.Date)].Text = DateTime.Now.ToString(); result.ShowDialog(); if (result.PlayGameAgain) { this.NewGame.PerformClick(); } break; case "Finished": switch (OptionsDialog.Level) { case 1: if (Minesweeper.Statistics.Current.BeginnerTime > TimeSeconds) { Minesweeper.Statistics.Current.BeginnerTime = TimeSeconds; Minesweeper.Statistics.Current.BeginnerDate = DateTime.Now; } break; case 2: if (Minesweeper.Statistics.Current.IntermediateTime > TimeSeconds) { Minesweeper.Statistics.Current.IntermediateTime = TimeSeconds; Minesweeper.Statistics.Current.IntermediateDate = DateTime.Now; } break; case 3: if (Minesweeper.Statistics.Current.AdvancedTime > TimeSeconds) { Minesweeper.Statistics.Current.AdvancedTime = TimeSeconds; Minesweeper.Statistics.Current.AdvancedDate = DateTime.Now; } break; } Minesweeper.Statistics.Current.Save(); result = new ResultDialog(); result.Controls[result.Controls.IndexOf(result.ResultLabel)].Text = "Congradulations, you won the game!"; result.Controls[result.Controls.IndexOf(result.Time)].Text = TimeSeconds.ToString() + " seconds"; result.Controls[result.Controls.IndexOf(result.Date)].Text = DateTime.Now.ToString(); result.ShowDialog(); if (result.PlayGameAgain) { this.NewGame.PerformClick(); } break; } }
private void showDialog(String message, Color bgColor) { ResultDialog dialog = new ResultDialog(message, bgColor); dialog.Show(); }