Example #1
0
        void RebuildVisualization(LevelFormula formula)
        {
            if (showCurve == null)
            {
                showCurve = new AnimationCurve();
            }

            ClearCurve();

            samplesString = "Level\tPointsNeeded\tPoints Delta (From Last Level Up)\n\n";
            int lastNeeded = (int)formula.PointsThreshold(samplesStart - 1);

            for (int i = 0; i < samplesRange; i++)
            {
                int l = samplesStart + i;

                int needed = (int)formula.PointsThreshold(l);
                int delta  = needed - lastNeeded;
                lastNeeded = needed;

                if (curveShowMode == CurveShowMode.PointsCap)
                {
                    showCurve.AddKey(l, needed);
                }
                else if (curveShowMode == CurveShowMode.PointsDifference)
                {
                    showCurve.AddKey(l, delta);
                }

                samplesString += l + "\t" + needed.LargeNumberToString() + "\t\t+" + delta.LargeNumberToString() + "\n";
            }
            curveDrawer.OnDisable();
        }