private void CheckForKeyPress() { if (this.InputManager.Jump != FezButtonState.Pressed && this.InputManager.CancelTalk != FezButtonState.Pressed) { return; } if (this.sinceStarted.TotalSeconds < 15.0) { this.sinceStarted = TimeSpan.FromSeconds(15.0); } else { this.state = LetterViewer.State.Out; } this.fader = TimeSpan.FromSeconds(0.25); }
public override void Update(GameTime gameTime) { if (this.GameState.Paused || this.GameState.InMap) { return; } this.sinceStarted += gameTime.ElapsedGameTime; if (this.state == LetterViewer.State.Wait) { this.CheckForKeyPress(); } else if (this.state == LetterViewer.State.Out) { this.fader -= gameTime.ElapsedGameTime; } else { this.fader += gameTime.ElapsedGameTime; this.CheckForKeyPress(); } if (this.fader.TotalSeconds <= 0.25 && this.fader.TotalSeconds >= 0.0) { return; } switch (this.state) { case LetterViewer.State.In: this.state = LetterViewer.State.Wait; break; case LetterViewer.State.Out: this.IsDisposed = true; ServiceHelper.RemoveComponent <LetterViewer>(this); break; } }
public override void Update(GameTime gameTime) { if (this.GameState.Paused || this.GameState.InMap) return; this.sinceStarted += gameTime.ElapsedGameTime; if (this.state == LetterViewer.State.Wait) this.CheckForKeyPress(); else if (this.state == LetterViewer.State.Out) { this.fader -= gameTime.ElapsedGameTime; } else { this.fader += gameTime.ElapsedGameTime; this.CheckForKeyPress(); } if (this.fader.TotalSeconds <= 0.25 && this.fader.TotalSeconds >= 0.0) return; switch (this.state) { case LetterViewer.State.In: this.state = LetterViewer.State.Wait; break; case LetterViewer.State.Out: this.IsDisposed = true; ServiceHelper.RemoveComponent<LetterViewer>(this); break; } }
private void CheckForKeyPress() { if (this.InputManager.Jump != FezButtonState.Pressed && this.InputManager.CancelTalk != FezButtonState.Pressed) return; if (this.sinceStarted.TotalSeconds < 15.0) this.sinceStarted = TimeSpan.FromSeconds(15.0); else this.state = LetterViewer.State.Out; this.fader = TimeSpan.FromSeconds(0.25); }