예제 #1
0
        /// <summary>Get an axis input value</summary>
        /// <param name="value">The input value, if any; Otherwise, the type's default value.</param>
        /// <returns>True if the input has a value; otherwise, false.</returns>
        protected override bool TryGetInputValue(IInputSource source, out float value)
        {
            float inputValue;

            if (source.TryGetAnalogInput(this.InputName, out inputValue))
            {
                value = this.modifier(inputValue);
                return(true);
            }
            else
            {
                value = 0f;
                return(false);
            }
        }