コード例 #1
0
ファイル: RandomW.cs プロジェクト: MeisterDerMagie/_Wichtel
        private float Next()
        {
            float next = 0f;

            //-- Discrepancy --
            //- High Discrepancy ("normal" random numbers / white noise) -
            if (!lowDiscrepancy)
            {
                next = simpleRng.GetFloatRange(0f, 1f);
            }
            //- Low Discrepancy (Grid & Jitter) -
            else
            {
                next = NextLowDiscrepancyFloat();
            }

            //-- Probability Distribution --
            //- Custom Distribution -
            if (probabilityDistribution == ProbabilityDistribution.Custom)
            {
                next = animationCurveSampler.Sample(next);
            }
            //- else: Uniform Probability Distribution -

            //-- Min Max Range --
            next = MathW.Remap(next, 0f, 1f, min, max);

            //-- Return final value --
            return(next);
        }