public TestInfoData()
        {
            Build = Application.version;
            var buildVersion = ConsoleArgumentHelper.GetArg("-buildNumber");

            if (!string.IsNullOrEmpty(buildVersion))
            {
                Build = Build + ":" + buildVersion;
            }
        }
Exemplo n.º 2
0
        public void SaveFPS(string tag)
        {
            FPSMetrics metrics = new FPSMetrics();
            string     textData;

            if (File.Exists(FPSMettricsFileFullPath))
            {
                try
                {
                    textData = File.ReadAllText(FPSMettricsFileFullPath);
                    metrics  = JObject.Parse(textData).ToObject <FPSMetrics>();
                }
                catch (Exception ex)
                {
                    Debug.LogWarning("file with fps metrics exists but can't be read " + ex.Message);
                }
            }

            metrics.Build = Application.version;
            var buildVersion = ConsoleArgumentHelper.GetArg("-buildNumber");

            if (!string.IsNullOrEmpty(buildVersion))
            {
                metrics.Build = metrics.Build + ":" + buildVersion;
            }

            if (metrics.Fps == null)
            {
                metrics.Fps = new Dictionary <string, FPSData>();
            }

            if (metrics.Fps.ContainsKey(tag))
            {
                tag = tag + "_" + Time.realtimeSinceStartup;
            }

            metrics.Fps.Add(tag, new FPSData
            {
                Min = MixFPS,
                Avg = AverageFPS,
                Max = MaxFPS
            });

            TestMetrics.CheckAndCreateFolder();

            textData = JObject.FromObject(metrics).ToString();
            File.WriteAllText(FPSMettricsFileFullPath, textData);
        }