Ejemplo n.º 1
0
        /// <summary>
        ///     Returns the maximum value that can be returned given the const/curve settings.
        ///     Note, in the case of curves, this will be inaccurate because there is no
        ///     nice way of getting the bounding box for an animation curve.
        /// </summary>
        /// <returns>The max value.</returns>
        public float GetMaxValue()
        {
            switch (rangeMode)
            {
            case RangeMode.Constant:
                return(m_ConstValueA);

            case RangeMode.Curve:
                return(m_CurveA.GetMaxValue());

            case RangeMode.RandomBetweenTwoConstants:
                return(HydraMathUtils.Max(m_ConstValueA, m_ConstValueB));

            case RangeMode.RandomBetweenTwoCurves:
                return(HydraMathUtils.Max(m_CurveA.GetMaxValue(), m_CurveB.GetMaxValue()));

            default:
                throw new ArgumentOutOfRangeException();
            }
        }