Ejemplo n.º 1
0
 /// <summary>
 /// Registered LateUpdate Event, controlled by the UpdatesBroadcaster.
 /// </summary>
 private void ManagedLateUpdateOne(EventData_Updates eventData)
 {
     for (int i = 0; i < components.Count; i++)
     {
         if (!components[i].isActiveAndEnabled)
         {
             continue;
         }
         components[i].ManagedLateUpdateOne(eventData);
     }
 }
        private void OnFpsUpdate24(EventData_Updates eventData)
        {
            _totalFramesPlayed += 1;

            int currFrame       = localUpdate ? _totalFramesPlayed : eventData.updateIndex;
            int currFrameLength = useLocalFrameLength ? frameLength : eventData.universalFrameLength;

            if ((currFrame % currFrameLength) == 0)
            {
                _totalFrameLengthsPlayed += 1;
            }
        }
Ejemplo n.º 3
0
        private void OnFpsUpdate24(EventData_Updates eventData)
        {
            float timeSinceLastUpdate = Time.time - _lastTime_fpsUpdate;

            _lastTime_fpsUpdate = Time.time;
            Debug.Log("dTime: " + timeSinceLastUpdate);

            if ((eventData.updateIndex % 24) == 0)
            {
                float timeSinceLastSecond = Time.time - _lastTime_fpsSecond;
                _lastTime_fpsSecond = Time.time;
                Debug.LogError("secTime: " + timeSinceLastSecond);
            }
        }
Ejemplo n.º 4
0
        private void OnFpsUpdate24(EventData_Updates eventData)
        {
            if (!updateWhileInactive && !isActiveAndEnabled)
            {
                return;
            }

            FpsUpdate24();

            //	No framelength setting, just update at max fps
            if (frameLengthFrom == FrameLengthSetting.None)
            {
                UpdateFrameLength();
                //TODO: Putting the increment in 2 spots is hacky
                _framesPlayed += 1;
                return;
            }

            int  frameLength  = GetFrameLength(eventData);
            bool shouldUpdate = false;

            if (localUpdate)
            {
                if ((_framesPlayed % frameLength) == 0)
                {
                    shouldUpdate = true;
                }
            }
            else
            {
                if ((eventData.updateIndex % frameLength) == 0)
                {
                    shouldUpdate = true;
                }
            }

            if (shouldUpdate)
            {
                UpdateFrameLength();
            }

            //TODO: Putting the increment in 2 spots is hacky
            _framesPlayed += 1;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Slow method for getting a frame length based on current settings.
        /// </summary>
        public int GetFrameLength(EventData_Updates eventData)
        {
            //TODO: Hard-coded goodness
            int value = 24;

            switch (frameLengthFrom)
            {
            case FrameLengthSetting.None:
                //TODO: Hard-coded goodness
                value = 24;
                break;

            case FrameLengthSetting.Universal:
                value = eventData.universalFrameLength;
                break;

            case FrameLengthSetting.Custom:
                value = frameLength_custom;
                break;
            }

            return(value);
        }
Ejemplo n.º 6
0
 private void SecondUpdate(EventData_Updates eventData)
 {
     Debug.Log("Second Update");
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Called by the controlling AteObject.
 /// That AteObject is responding to EventManager events.
 /// </summary>
 public void ManagedLateUpdateOne(EventData_Updates eventData)
 {
     AteLateUpdate();
 }