Пример #1
0
        /// <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();
            }
        }
Пример #2
0
 /// <summary>
 ///     Evaluates the curve sets and returns a random Vector3 between them.
 /// </summary>
 /// <returns>The random Vector3 between curve sets.</returns>
 /// <param name="time">Time.</param>
 private Vector3 GetRandomBetweenCurveSets(float time)
 {
     return(m_RandomVector3Generator.Range(m_CurvesA.GetValue(time), m_CurvesB.GetValue(time), m_Linear));
 }