Пример #1
0
        public void StartLateUpdateCall(Component _component)
        {
            currentUpdateProfile = GetComponentProfileFromList(_component);
            currentUpdateProfile.lateUpdateCalls++;

            currentUpdateProfile.updateStopwatch.Start();
        }
Пример #2
0
        private ComponentUpdateProfile GetComponentProfileFromList(Component _component)
        {
            for (int i = 0; i < componentUpdateProfiles.Count; i++)
            {
                if (componentUpdateProfiles[i].component.GetType() == _component.GetType())
                {
                    return(componentUpdateProfiles[i]);
                }
            }
            ComponentUpdateProfile updateProfile = new ComponentUpdateProfile(_component);

            componentUpdateProfiles.Add(updateProfile);

            return(updateProfile);
        }
Пример #3
0
        public ComponentUpdateProfile GetWorst()
        {
            ComponentUpdateProfile worst = new ComponentUpdateProfile(null);

            /*for (int i = 0; i < componentUpdateProfiles.Count; i++)
             * {
             *  if (componentUpdateProfiles[i].totalTicks > worst.totalTicks)
             *  {
             *      worst = componentUpdateProfiles[i];
             *  }
             * }*/

            //if (worst.name == null)
            //{
            //    Debug.Log("whuaa");
            //}
            if (componentUpdateProfiles.Count == 0)
            {
                return(new ComponentUpdateProfile());
            }
            return(componentUpdateProfiles[0]);
        }