/// <summary> /// Gets a value based on RangeMode. /// </summary> /// <returns>A value based on RangeMode.</returns> public Vector3 GetValue(float time) { switch (rangeMode) { case RangeMode.Constant: return(m_ConstValueA.vector); case RangeMode.CurveSet: return(m_CurvesA.GetValue(time)); case RangeMode.RandomBetweenTwoConstants: return(m_RandomVector3Generator.Range(m_ConstValueA.vector, m_ConstValueB.vector, m_Linear)); case RangeMode.RandomBetweenTwoCurveSets: return(GetRandomBetweenCurveSets(time)); default: throw new ArgumentOutOfRangeException(); } }
/// <summary> /// Gets a value based on RangeMode. /// </summary> /// <returns>A value based on RangeMode.</returns> public float GetValue(float time) { switch (rangeMode) { case RangeMode.Constant: return(m_ConstValueA); case RangeMode.Curve: return(m_CurveA.Evaluate(time)); case RangeMode.RandomBetweenTwoConstants: return(m_RandomNumberGenerator.Range(m_ConstValueA, m_ConstValueB)); case RangeMode.RandomBetweenTwoCurves: return(m_RandomNumberGenerator.Range(m_CurveA.Evaluate(time), m_CurveB.Evaluate(time))); default: throw new ArgumentOutOfRangeException(); } }
/// <summary> /// Gets the color between specified values. /// </summary> /// <returns>The color between values.</returns> /// <param name="colorA">Color a.</param> /// <param name="colorB">Color b.</param> private Color GetColorBetweenValues(Color colorA, Color colorB) { switch (m_RandomBlend) { case ColorUtils.Gamut.RGB: return(m_RandomColorGenerator.Range(colorA, colorB, m_Linear)); case ColorUtils.Gamut.HSL: return(m_RandomColorGenerator.RangeHsl(colorA, colorB, m_Linear)); default: throw new ArgumentOutOfRangeException(); } }