Пример #1
0
 private void OnPressureChanged(object sender, PressureChangedEventArgs args)
 {
     if (args.Pressure >= 1)
     {
         // Defeat!
         this.EventManager.OnDefeat(this, EventArgs.Empty);
     }
 }
Пример #2
0
        private void OnPressureChanged(object sender, PressureChangedEventArgs args)
        {
            if (args.Delta < 0)
            {
                return;
            }

            this.totalPressure += args.Delta;
        }
Пример #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);
     }
 }
Пример #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);
            }
        }
Пример #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);
            }
        }
Пример #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);
            }
        }
Пример #7
0
 public void OnPressureChanged(object sender, PressureChangedEventArgs args)
 {
     var handler = this.PressureChanged;
     if (handler != null)
     {
         handler(sender, args);
     }
 }
Пример #8
0
 private void OnPressureChanged(object sender, PressureChangedEventArgs args)
 {
     this.currentPressure = args.Pressure;
 }