Beispiel #1
0
        private void DrawLine(string statsKey)
        {
            GUI.get_skin().get_label().set_alignment(4);
            Color     color    = this.statsUI[statsKey].color;
            float     maxValue = this.statsUI[statsKey].maxValue;
            int       num      = (this.lockstep.compoundStats.bufferStats.currentIndex + 1) % this.lockstep.compoundStats.bufferStats.size;
            CountInfo info     = this.lockstep.compoundStats.bufferStats.buffer[num].GetInfo(statsKey);
            float     num2     = this.statsUI[statsKey].isAvg ? info.average() : ((float)info.count);
            Vector2   pointA   = new Vector2((float)this.marginLeft, (float)this.height * (1f - Mathf.Min(num2 / maxValue, 1f)));

            for (int i = 2; i <= this.lockstep.compoundStats.bufferStats.size - 1; i++)
            {
                int       num3  = (this.lockstep.compoundStats.bufferStats.currentIndex + i) % this.lockstep.compoundStats.bufferStats.size;
                CountInfo info2 = this.lockstep.compoundStats.bufferStats.buffer[num3].GetInfo(statsKey);
                num2 = (this.statsUI[statsKey].isAvg ? info2.average() : ((float)info2.count));
                Vector2 vector = new Vector2((float)this.marginLeft + this.barWidth * (float)(i - 1), (float)this.height * (1f - Mathf.Min(num2 / maxValue, 1f)));
                Drawing.DrawLine(pointA, vector, color);
                pointA = vector;
            }
        }
        private void DrawLine(string statsKey)
        {
            GUI.skin.label.alignment = TextAnchor.MiddleCenter;
            Color     color    = this.statsUI[statsKey].color;
            float     maxValue = this.statsUI[statsKey].maxValue;
            int       num      = (this.lockstep.compoundStats.bufferStats.currentIndex + 1) % this.lockstep.compoundStats.bufferStats.size;
            CountInfo info     = this.lockstep.compoundStats.bufferStats.buffer[num].GetInfo(statsKey);
            float     num2     = this.statsUI[statsKey].isAvg ? info.average() : ((float)info.count);

            this.baseVector.x = (float)this.marginLeft;
            this.baseVector.y = (float)this.height * (1f - Mathf.Min(num2 / maxValue, 1f));
            for (int i = 2; i <= this.lockstep.compoundStats.bufferStats.size - 1; i++)
            {
                int       num3  = (this.lockstep.compoundStats.bufferStats.currentIndex + i) % this.lockstep.compoundStats.bufferStats.size;
                CountInfo info2 = this.lockstep.compoundStats.bufferStats.buffer[num3].GetInfo(statsKey);
                num2          = (this.statsUI[statsKey].isAvg ? info2.average() : ((float)info2.count));
                this.newPos.x = (float)this.marginLeft + this.barWidth * (float)(i - 1);
                this.newPos.y = (float)this.height * (1f - Mathf.Min(num2 / maxValue, 1f));
                Drawing.DrawLine(this.baseVector, this.newPos, color);
                this.baseVector = this.newPos;
            }
        }