示例#1
0
        public void OnReportFirstGameplayEventButtonClicked()
        {
            var result = InsightsKit.ReportFirstGameplayEvent();

            if (result == Trail.Result.Ok)
            {
                Debug.Log("Report first gameplay event succeeded");
            }
            else
            {
                Debug.LogErrorFormat("Report first gameplay event failed: {0}", result.ToString());
            }
        }
示例#2
0
        public void OnReportSceneChangedButtonClicked()
        {
            var scene = SceneManager.GetActiveScene();

            Debug.LogFormat("Reporting scene changed: id = {0} name = {1}", scene.path, scene.name);
            var result = InsightsKit.ReportSceneChanged(scene);

            if (result == Trail.Result.Ok)
            {
                Debug.Log("Report scene changed succeeded");
            }
            else
            {
                Debug.LogErrorFormat("Report scene changed failed: {0}", result.ToString());
            }
        }
示例#3
0
        public void OnSendTrailCustomEvent()
        {
            var name    = "custom-event";
            var payload = "{\"json\": \"payload\"}";

            Debug.LogFormat("Reporting custom event: name = \"{0}\" payloadJSON = {1}", name, payload);
            var result = InsightsKit.SendCustomEvent(name, payload);

            if (result == Trail.Result.Ok)
            {
                Debug.Log("Send custom event succeeded");
            }
            else
            {
                Debug.LogErrorFormat("Send custom event failed: {0}", result.ToString());
            }
        }
示例#4
0
        public void OnReportQualityLevelChangedButtonClicked()
        {
            var level = QualitySettings.GetQualityLevel();
            var name  = QualitySettings.names[level];
            int ql    = (int)Math.Round(100.0f * (float)(level + 1) / QualitySettings.names.Length);

            Debug.LogFormat("Reporting quality level changed: level = {0} name = {1}", ql, name);
            var result = InsightsKit.ReportQualityLevelChanged(ql, name);

            if (result == Trail.Result.Ok)
            {
                Debug.Log("Report quality level changed succeeded");
            }
            else
            {
                Debug.LogErrorFormat("Report quality level changed failed: {0}", result.ToString());
            }
        }
示例#5
0
        public void OnReportGameResolutionChangedButtonClicked()
        {
            var rs = Screen.currentResolution;

            Debug.LogFormat(
                "Reporting resolution changed: width = {0} height = {1}",
                rs.width,
                rs.height
                );
            var result = InsightsKit.ReportResolutionChanged(rs);

            if (result == Trail.Result.Ok)
            {
                Debug.Log("Report resolution changed succeeded");
            }
            else
            {
                Debug.LogErrorFormat("Report resolution changed failed: {0}", result.ToString());
            }
        }