/// <summary>
        /// Generates one sample
        /// </summary>
        /// <returns>The generated sample</returns>
        public float Sample()
        {
            var rng = SamplerState.CreateGenerator();

            return(SamplerUtility.TruncatedNormalSample(
                       rng.NextFloat(), range.minimum, range.maximum, mean, standardDeviation));
        }
        /// <summary>
        /// Generates one sample
        /// </summary>
        /// <returns>The generated sample</returns>
        public float Sample()
        {
            Initialize();
            var rng = SamplerState.CreateGenerator();

            return(SamplerUtility.AnimationCurveSample(
                       m_IntegratedCurve, rng.NextFloat(), m_Interval, m_StartTime, m_EndTime));
        }
        void Initialize()
        {
            if (m_Initialized)
            {
                return;
            }

            Validate();
            m_IntegratedCurve = new float[numOfSamplesForIntegration];
            SamplerUtility.IntegrateCurve(m_IntegratedCurve, distributionCurve);
            m_StartTime   = distributionCurve.keys[0].time;
            m_EndTime     = distributionCurve.keys[distributionCurve.length - 1].time;
            m_Interval    = (m_EndTime - m_StartTime) / (numOfSamplesForIntegration - 1);
            m_Initialized = true;
        }