Exemplo n.º 1
0
 private void OnPressureChanged(object sender, PressureChangedEventArgs args)
 {
     if (args.Pressure >= 1)
     {
         // Defeat!
         this.EventManager.OnDefeat(this, EventArgs.Empty);
     }
 }
Exemplo n.º 2
0
        private void OnPressureChanged(object sender, PressureChangedEventArgs args)
        {
            if (args.Delta < 0)
            {
                return;
            }

            this.totalPressure += args.Delta;
        }
Exemplo n.º 3
0
 private void OnPressureChanged(object sender, PressureChangedEventArgs args)
 {
     if (this.currentObjective != null)
     {
         this.currentObjective.transform.localScale = Vector3.one
                                                      * (1
                                                         + args.Pressure
                                                         * this.LevelSettings.ItemSizePressureFactor);
     }
 }
Exemplo n.º 4
0
        private void OnPressureChanged(object sender, PressureChangedEventArgs args)
        {
            if (this.PressureSlider != null)
            {
                this.PressureSlider.value = args.Pressure;
            }

            if (this.PressureSliderFill != null)
            {
                this.PressureSliderFill.color = Color.Lerp(Color.green, Color.red, args.Pressure);
            }
        }
Exemplo n.º 5
0
        private void OnPressureChanged(object sender, PressureChangedEventArgs args)
        {
            if (!this.AudioSource.isPlaying)
            {
                // Select clip.
                var clip =
                    this.Clips.OrderByDescending(c => c.MinimumPressure)
                        .FirstOrDefault(c => c.MinimumPressure <= args.Pressure);

                if (clip == null)
                {
                    Debug.LogWarning(
                        string.Format("No feasible music clip found for pressure level: {0}", args.Pressure));
                    return;
                }

                this.AudioSource.PlayOneShot(clip.Clip);
            }
        }
Exemplo n.º 6
0
        private void OnPressureChanged(object sender, PressureChangedEventArgs args)
        {
            if (this.Player == null)
            {
                return;
            }

            if (this.Player.VignetteAndChromaticAberration != null)
            {
                this.Player.VignetteAndChromaticAberration.chromaticAberration =
                    this.LevelSettings.ChromaticAbberationStrength * args.Pressure
                    * Mathf.Sin(Time.realtimeSinceStartup);
            }

            if (this.Player.Twirl != null)
            {
                this.Player.Twirl.angle = this.LevelSettings.TwirlStrength * args.Pressure
                                          * Mathf.Sin(Time.realtimeSinceStartup * 2.0f);
            }
        }
Exemplo n.º 7
0
 public void OnPressureChanged(object sender, PressureChangedEventArgs args)
 {
     var handler = this.PressureChanged;
     if (handler != null)
     {
         handler(sender, args);
     }
 }
Exemplo n.º 8
0
 private void OnPressureChanged(object sender, PressureChangedEventArgs args)
 {
     this.currentPressure = args.Pressure;
 }