Пример #1
0
        /// <summary>
        /// Send telemetry to report the beginning of a transaction, including any state properties which have been set.
        /// </summary>
        /// <param name="timeout">How long to keep the transaction 'open' without new activity</param>
        /// <param name="mode">The type of activity which will keep the transaction open</param>
        public void Send(Vector3 position)
        {
            float[] pos = new float[3] {
                0, 0, 0
            };

            pos[0] = position.x;
            pos[1] = position.y;
            pos[2] = position.z;

            Instrumentation.SendCustomEvent(_category, _properties, pos);
        }
Пример #2
0
        private void CognitiveVR_Manager_TickEvent()
        {
            if (IsVideo) { return; }
            if (WasPlaying)
            {
                if (!VideoPlayer.isPlaying)
                {
                    if (VideoPlayer.frame == 0)
                    {
                        //stopped event
                        Instrumentation.SendCustomEvent("cvr.media.stop", new List<KeyValuePair<string, object>>() {new KeyValuePair<string, object>( "videoTime", lastFrame ), new KeyValuePair<string, object>("mediaId", MediaSource ) },transform.position);
                    }
                    else
                    {
                        //paused event
                        Instrumentation.SendCustomEvent("cvr.media.pause", new List<KeyValuePair<string, object>>() { new KeyValuePair<string, object>("videoTime", VideoPlayer.frame ), new KeyValuePair<string, object>("mediaId", MediaSource ) }, transform.position);
                    }
                    WasPlaying = false;
                }
                lastFrame = VideoPlayer.frame;
            }
            else
            {
                if (VideoPlayer.isPlaying)
                {
                    //play event
                    Instrumentation.SendCustomEvent("cvr.media.play", new List<KeyValuePair<string, object>>() { new KeyValuePair<string, object>("videoTime", VideoPlayer.frame ), new KeyValuePair<string, object>("mediaId", MediaSource ) }, transform.position);
                    WasPlaying = true;
                }
            }
            //register to prepare_complete to see if video has finished buffering
            //how to tell if video starts buffering again?

            if (wasPrepared)
            {
                if (!VideoPlayer.isPrepared) //started buffering. possibly stopped
                {
                    wasPrepared = false;
                    Instrumentation.SendCustomEvent("cvr.media.videoBuffer", new List<KeyValuePair<string, object>>() { new KeyValuePair<string, object>("videoTime", VideoPlayer.frame ), new KeyValuePair<string, object>("mediaId", MediaSource ) }, transform.position);
                }
            }
            else
            {
                if (VideoPlayer.isPrepared) //finishing buffering
                {
                    wasPrepared = true;
                }
            }
        }
Пример #3
0
        /// <summary>
        /// Send telemetry to report the beginning of a transaction, including any state properties which have been set.
        /// </summary>
        /// <param name="timeout">How long to keep the transaction 'open' without new activity</param>
        /// <param name="mode">The type of activity which will keep the transaction open</param>
        public void Send()
        {
            if (HMD == null)
            {
                return;
            }

            float[] pos = new float[3] {
                0, 0, 0
            };

            pos[0] = HMD.position.x;
            pos[1] = HMD.position.y;
            pos[2] = HMD.position.z;

            Instrumentation.SendCustomEvent(_category, _properties, pos);
        }
Пример #4
0
        /// <summary>
        /// Send telemetry to report the beginning of a transaction, including any state properties which have been set.
        /// </summary>
        /// <param name="timeout">How long to keep the transaction 'open' without new activity</param>
        /// <param name="mode">The type of activity which will keep the transaction open</param>
        public void Send(Vector3 position)
        {
            float[] pos = new float[3] {
                0, 0, 0
            };

            pos[0] = position.x;
            pos[1] = position.y;
            pos[2] = position.z;

            float duration = Time.realtimeSinceStartup - startTime;

            if (duration > 0.011f)
            {
                SetProperty("duration", duration);
            }

            Instrumentation.SendCustomEvent(category, _properties, pos, dynamicObjectId);
        }
Пример #5
0
 public void beginAndEnd(Vector3 position, string result = TXN_SUCCESS)
 {
     Instrumentation.SendCustomEvent(_category, _properties, position);
 }
Пример #6
0
 public void begin(double timeout = 0, TimeoutMode mode = TimeoutMode.Transaction)
 {
     Instrumentation.SendCustomEvent(_category, _properties, HMD.position);
 }
Пример #7
0
 public void end(string result = TXN_SUCCESS)
 {
     Instrumentation.SendCustomEvent(_category, _properties, HMD.position);
 }
Пример #8
0
 public void update(int progress)
 {
     Instrumentation.SendCustomEvent(_category, _properties, HMD.position);
 }