예제 #1
0
 public void ChangeControllerSensitivity(float amount)
 {
     if (controllerSensitivity != amount)
     {
         controllerSensitivity = EonMathHelper.Clamp(controllerSensitivity, 0.1f, 0.9f);
     }
 }
예제 #2
0
 /// <summary>
 /// Used to set the sensitivity of the Mouse.
 /// </summary>
 /// <param name="value">The value to set the sensitivity to.</param>
 public void SetMouseSensitivity(float value)
 {
     if (sensitivity != value)
     {
         sensitivity = EonMathHelper.Clamp(sensitivity, 1, 100);
     }
 }
예제 #3
0
        /// <summary>
        /// Sets the volume of this Cinematic.
        /// </summary>
        /// <param name="amount">The amount to set the volume by.</param>
        public void SetVolume(float amount)
        {
            if (amount > 1 || amount < 0)
            {
                amount = EonMathHelper.Clamp(amount);
            }

            vidPlayer.Volume = amount;
        }
예제 #4
0
        /// <summary>
        /// Changes the volume of an existing audio category.
        /// </summary>
        /// <param name="value">The volume to change to.</param>
        /// <param name="audioCategory">The audio category to be eddited.</param>
        public static void ChangeVolume(float value, string audioCategory)
        {
            value = EonMathHelper.Clamp(value, 0, 100);

            if (audioEngine.GetCategory(audioCategory).Name != null)
            {
                audioEngine.GetCategory(audioCategory).SetVolume(value);
            }
            else
            {
                throw new ArgumentNullException("Invalid audio category: " + audioCategory);
            }
        }
예제 #5
0
        public void SetVibration(float leftMotor, float rightMotor, float duration)
        {
            if (IsPadConnected)
            {
                if (VibrateEnabled)
                {
                    leftMotor  = EonMathHelper.Clamp(leftMotor, 0.0f, 1.0f);
                    rightMotor = EonMathHelper.Clamp(rightMotor, 0.0f, 1.0f);

                    vibrationDuration = TimeSpan.FromMilliseconds(duration);
                    vibrationIntencity[(int)TriggersIdx.Left]  = leftMotor;
                    vibrationIntencity[(int)TriggersIdx.Right] = rightMotor;
                }
            }
        }