コード例 #1
0
 private void PerformUpdate()
 {
     UISystemProfilerApi.BeginSample(UISystemProfilerApi.SampleType.Layout);
     this.CleanInvalidItems();
     this.m_PerformingLayoutUpdate = true;
     this.m_LayoutRebuildQueue.Sort(CanvasUpdateRegistry.s_SortLayoutFunction);
     for (int i = 0; i <= 2; i++)
     {
         for (int j = 0; j < this.m_LayoutRebuildQueue.Count; j++)
         {
             ICanvasElement canvasElement = CanvasUpdateRegistry.instance.m_LayoutRebuildQueue[j];
             try
             {
                 if (this.ObjectValidForUpdate(canvasElement))
                 {
                     canvasElement.Rebuild((CanvasUpdate)i);
                 }
             }
             catch (Exception exception)
             {
                 Debug.LogException(exception, canvasElement.transform);
             }
         }
     }
     for (int k = 0; k < this.m_LayoutRebuildQueue.Count; k++)
     {
         this.m_LayoutRebuildQueue[k].LayoutComplete();
     }
     CanvasUpdateRegistry.instance.m_LayoutRebuildQueue.Clear();
     this.m_PerformingLayoutUpdate = false;
     ClipperRegistry.instance.Cull();
     this.m_PerformingGraphicUpdate = true;
     for (int l = 3; l < 5; l++)
     {
         for (int m = 0; m < CanvasUpdateRegistry.instance.m_GraphicRebuildQueue.Count; m++)
         {
             try
             {
                 ICanvasElement canvasElement2 = CanvasUpdateRegistry.instance.m_GraphicRebuildQueue[m];
                 if (this.ObjectValidForUpdate(canvasElement2))
                 {
                     canvasElement2.Rebuild((CanvasUpdate)l);
                 }
             }
             catch (Exception exception2)
             {
                 Debug.LogException(exception2, CanvasUpdateRegistry.instance.m_GraphicRebuildQueue[m].transform);
             }
         }
     }
     for (int n = 0; n < this.m_GraphicRebuildQueue.Count; n++)
     {
         this.m_GraphicRebuildQueue[n].GraphicUpdateComplete();
     }
     CanvasUpdateRegistry.instance.m_GraphicRebuildQueue.Clear();
     this.m_PerformingGraphicUpdate = false;
     UISystemProfilerApi.EndSample(UISystemProfilerApi.SampleType.Layout);
 }
コード例 #2
0
 private void PerformUpdate()
 {
     CleanInvalidItems();
     m_PerformingLayoutUpdate = true;
     m_LayoutRebuildQueue.Sort(s_SortLayoutFunction);
     for (int i = 0; i <= 2; i++)
     {
         for (int j = 0; j < m_LayoutRebuildQueue.Count; j++)
         {
             ICanvasElement canvasElement = instance.m_LayoutRebuildQueue[j];
             try
             {
                 if (ObjectValidForUpdate(canvasElement))
                 {
                     canvasElement.Rebuild((CanvasUpdate)i);
                 }
             }
             catch (Exception exception)
             {
                 Debug.LogException(exception, canvasElement.transform);
             }
         }
     }
     for (int k = 0; k < m_LayoutRebuildQueue.Count; k++)
     {
         m_LayoutRebuildQueue[k].LayoutComplete();
     }
     instance.m_LayoutRebuildQueue.Clear();
     m_PerformingLayoutUpdate = false;
     ClipperRegistry.instance.Cull();
     m_PerformingGraphicUpdate = true;
     for (int l = 3; l < 5; l++)
     {
         for (int m = 0; m < instance.m_GraphicRebuildQueue.Count; m++)
         {
             try
             {
                 ICanvasElement canvasElement2 = instance.m_GraphicRebuildQueue[m];
                 if (ObjectValidForUpdate(canvasElement2))
                 {
                     canvasElement2.Rebuild((CanvasUpdate)l);
                 }
             }
             catch (Exception exception2)
             {
                 Debug.LogException(exception2, instance.m_GraphicRebuildQueue[m].transform);
             }
         }
     }
     for (int n = 0; n < m_GraphicRebuildQueue.Count; n++)
     {
         m_GraphicRebuildQueue[n].LayoutComplete();
     }
     instance.m_GraphicRebuildQueue.Clear();
     m_PerformingGraphicUpdate = false;
 }
コード例 #3
0
 private void PerformUpdate()
 {
     this.CleanInvalidItems();
     this.m_PerformingLayoutUpdate = true;
     this.m_LayoutRebuildQueue.Sort(CanvasUpdateRegistry.s_SortLayoutFunction);
     for (int index1 = 0; index1 <= 2; ++index1)
     {
         for (int index2 = 0; index2 < this.m_LayoutRebuildQueue.Count; ++index2)
         {
             ICanvasElement layoutRebuild = CanvasUpdateRegistry.instance.m_LayoutRebuildQueue[index2];
             try
             {
                 if (this.ObjectValidForUpdate(layoutRebuild))
                 {
                     layoutRebuild.Rebuild((CanvasUpdate)index1);
                 }
             }
             catch (Exception ex)
             {
                 Debug.LogException(ex, (UnityEngine.Object)layoutRebuild.transform);
             }
         }
     }
     for (int index = 0; index < this.m_LayoutRebuildQueue.Count; ++index)
     {
         this.m_LayoutRebuildQueue[index].LayoutComplete();
     }
     CanvasUpdateRegistry.instance.m_LayoutRebuildQueue.Clear();
     this.m_PerformingLayoutUpdate = false;
     ClipperRegistry.instance.Cull();
     this.m_PerformingGraphicUpdate = true;
     for (int index1 = 3; index1 < 5; ++index1)
     {
         for (int index2 = 0; index2 < CanvasUpdateRegistry.instance.m_GraphicRebuildQueue.Count; ++index2)
         {
             try
             {
                 ICanvasElement graphicRebuild = CanvasUpdateRegistry.instance.m_GraphicRebuildQueue[index2];
                 if (this.ObjectValidForUpdate(graphicRebuild))
                 {
                     graphicRebuild.Rebuild((CanvasUpdate)index1);
                 }
             }
             catch (Exception ex)
             {
                 Debug.LogException(ex, (UnityEngine.Object)CanvasUpdateRegistry.instance.m_GraphicRebuildQueue[index2].transform);
             }
         }
     }
     for (int index = 0; index < this.m_GraphicRebuildQueue.Count; ++index)
     {
         this.m_GraphicRebuildQueue[index].LayoutComplete();
     }
     CanvasUpdateRegistry.instance.m_GraphicRebuildQueue.Clear();
     this.m_PerformingGraphicUpdate = false;
 }
コード例 #4
0
    public static int Rebuild(IntPtr l)
    {
        int result;

        try
        {
            ICanvasElement canvasElement = (ICanvasElement)LuaObject.checkSelf(l);
            CanvasUpdate   executing;
            LuaObject.checkEnum <CanvasUpdate>(l, 2, out executing);
            canvasElement.Rebuild(executing);
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
コード例 #5
0
 private void PerformUpdateForCanvasRendererObjects()
 {
     for (int i = 0; i < m_LayoutRebuildQueue.Count; i++)
     {
         ICanvasElement canvasElement = instance.m_LayoutRebuildQueue[i];
         canvasElement.Rebuild(CanvasUpdate.Prelayout);
     }
     if (m_LayoutRebuildQueue.Count > 0)
     {
         m_LayoutRebuildQueue.Clear();
         m_LayoutQueueLookup.Clear();
     }
     for (int j = 0; j < m_GraphicRebuildQueue.Count; j++)
     {
         ICanvasElement canvasElement2 = instance.m_GraphicRebuildQueue[j];
         canvasElement2.Rebuild(CanvasUpdate.PreRender);
     }
     if (m_GraphicRebuildQueue.Count > 0)
     {
         m_GraphicRebuildQueue.Clear();
         m_GraphicQueueLookup.Clear();
     }
 }
コード例 #6
0
 private void PerformUpdateForCanvasRendererObjects()
 {
     for (int i = 0; i < m_LayoutRebuildQueue.Count; i++)
     {
         ICanvasElement val = instance.m_LayoutRebuildQueue[i];
         val.Rebuild((CanvasUpdate)0);
     }
     if (m_LayoutRebuildQueue.Count > 0)
     {
         m_LayoutRebuildQueue.Clear();
         m_LayoutQueueLookup.Clear();
     }
     for (int j = 0; j < m_GraphicRebuildQueue.Count; j++)
     {
         ICanvasElement val2 = instance.m_GraphicRebuildQueue[j];
         val2.Rebuild((CanvasUpdate)3);
     }
     if (m_GraphicRebuildQueue.Count > 0)
     {
         m_GraphicRebuildQueue.Clear();
         m_GraphicQueueLookup.Clear();
     }
 }
コード例 #7
0
ファイル: TMP_UpdateRegistery.cs プロジェクト: tgdwyer/ImAxes
        /// <summary>
        /// Method to handle objects that need updating.
        /// </summary>
        private void PerformUpdateForCanvasRendererObjects()
        {
            //Debug.Log("Performing update of CanvasRenderer objects at Frame: " + Time.frameCount);

            // Processing elements that require a layout rebuild.
            //this.m_PerformingLayoutUpdate = true;
            for (int index = 0; index < m_LayoutRebuildQueue.Count; index++)
            {
                ICanvasElement element = TMP_UpdateRegistry.instance.m_LayoutRebuildQueue[index];

                element.Rebuild(CanvasUpdate.Prelayout);
            }
            //this.m_PerformingLayoutUpdate = false;
            if (m_LayoutRebuildQueue.Count > 0)
            {
                m_LayoutRebuildQueue.Clear();
                m_LayoutQueueLookup.Clear();
            }


            // Processing elements that require a graphic rebuild.
            //this.m_PerformingGraphicUpdate = true;
            for (int index = 0; index < m_GraphicRebuildQueue.Count; index++)
            {
                ICanvasElement element = TMP_UpdateRegistry.instance.m_GraphicRebuildQueue[index];

                element.Rebuild(CanvasUpdate.PreRender);
            }
            //this.m_PerformingGraphicUpdate = false;

            // If there are no objects in the queue, we don't need to clear the lists again.
            if (m_GraphicRebuildQueue.Count > 0)
            {
                m_GraphicRebuildQueue.Clear();
                m_GraphicQueueLookup.Clear();
            }
        }