Example #1
0
        private void Update()
        {
            int idx = QualitySettings.GetQualityLevel();

            if (idx != lastQualityIdx)
            {
                InsightsKit.ReportUnityQuality();
                lastQualityIdx = idx;
            }
        }
Example #2
0
        internal static void ReportUnityQuality()
        {
            var names = QualitySettings.names;
            var level = QualitySettings.GetQualityLevel();

            if (names == null || names.Length == 0)
            {
                InsightsKit.ReportQualityLevelChanged(100, "no name");
                return;
            }
            if (names.Length == 1)
            {
                InsightsKit.ReportQualityLevelChanged(100, names[0]);
                return;
            }
            var normLevel = (float)level /
                            Mathf.Max(1f, (float)names.Length - 1.0f);
            var quality = normLevel * 99.0f + 1.0f;

            InsightsKit.ReportQualityLevelChanged(
                Mathf.RoundToInt(quality),
                names[level]
                );
        }
Example #3
0
 private static void OnSceneChanged(UnityEngine.SceneManagement.Scene current, UnityEngine.SceneManagement.Scene next)
 {
     InsightsKit.ReportSceneChanged(next);
 }