Exemple #1
0
        public void Save()
        {
            if (this.mFps.Count <= 0)
            {
                return;
            }
            int num  = 0;
            int num2 = this.mFps[0];
            int num3 = this.mFps[0];

            foreach (int current in this.mFps)
            {
                num += current;
                if (current > num3)
                {
                    num3 = current;
                }
                if (current < num2)
                {
                    num2 = current;
                }
            }
            int     avg        = num / this.mFps.Count;
            string  fpsDotsStr = this.GetFpsDotsStr();
            FpsInfo fpsInfo    = new FpsInfo(this.mTagId, avg, num3, num2, this.mFps.Count, this.mHTimes, this.mLTimes, this.mCusTimes, fpsDotsStr);

            this.mLastInfo = fpsInfo;
        }
Exemple #2
0
        public static void End()
        {
            FpsInfo fpsInfo = null;

            if (GSDK.sFpsRecorder != null)
            {
                GSDK.sFpsRecorder.Finish();
                fpsInfo = GSDK.sFpsRecorder.GetLastFpsInfo();
            }
            string graphicsDeviceName = SystemInfo.graphicsDeviceName;

            GSDK.sGSDKPlatformClass.CallStatic("GSDKSaveGpuInfo", new object[]
            {
                graphicsDeviceName
            });
            if (fpsInfo == null)
            {
                GSDK.sGSDKPlatformClass.CallStatic("GSDKSaveFps", new object[]
                {
                    string.Empty,
                    -1,
                    -1,
                    -1,
                    -1,
                    -1,
                    -1,
                    -1,
                    "-1"
                });
                GSDK.sGSDKPlatformClass.CallStatic("GSDKEnd", new object[0]);
            }
            else
            {
                GSDK.sGSDKPlatformClass.CallStatic("GSDKSaveFps", new object[]
                {
                    fpsInfo.tag,
                    fpsInfo.avg,
                    fpsInfo.max,
                    fpsInfo.min,
                    fpsInfo.totalTimes,
                    fpsInfo.heavyTimes,
                    fpsInfo.lightTimes,
                    fpsInfo.cusTimes,
                    fpsInfo.fpsdots
                });
                GSDK.sGSDKPlatformClass.CallStatic("GSDKEnd", new object[0]);
            }
        }
Exemple #3
0
 private void resetData()
 {
     this.mTagId = string.Empty;
     if (this.mFps != null)
     {
         this.mFps.Clear();
     }
     if (this.mFpsDots != null)
     {
         this.mFpsDots.Clear();
     }
     this.mLastFps  = -1;
     this.mHTimes   = 0;
     this.mLTimes   = 0;
     this.mCusTimes = 0;
     this.mLastInfo = null;
 }