Ejemplo n.º 1
0
 void Batch2()
 {
     if (subFrame == mainFrame)
     {
         MatCollector.renderQueue = renderQueue;
         LateFrame++;
         point   = 1;
         max     = 0;
         top_txt = 0;
         Collection(transform, -1, 0);
         //MainUpdate();
         for (int i = 1; i < max; i++)//跳过HCanvas
         {
             var scr = scripts[i];
             if (scr.LateFrame != LateFrame)
             {
                 scr.LateFrame = LateFrame;
                 scr.MainUpdate();
             }
             else
             {
                 Debug.Log("脚本重复更新");
             }
         }
         Collection(transform, -1, 0);
         for (int i = 0; i < top_txt; i++)
         {
             texts[i].Populate();
         }
         if (ftr)//纹理被改变了,需要重新计算
         {
             ftr = false;
             HText.DirtyAll();
             for (int i = 0; i < top_txt; i++)
             {
                 texts[i].Populate();
             }
         }
         ApplyMeshRenderer();
         ApplyToCamera();
         mainFrame++;
         if (thread == null)
         {
             thread = new ThreadMission("UI");
         }
         thread.AddSubMission((o) => {
             Batch();
             subFrame++;
         }, this);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新内容包含:UI流水线采集,UI MainUpdate函数执行,UI Populate函数执行,文本更新,合批处理,应用网格,投递到相机
 /// </summary>
 private void LateUpdate()
 {
     if (Pause)
     {
         return;
     }
     if (SubBatch)
     {
         Batch2();
         return;
     }
     MatCollector.renderQueue = renderQueue;
     LateFrame++;
     point   = 1;
     max     = 0;
     top_txt = 0;
     Collection(transform, -1, 0);
     //MainUpdate();
     for (int i = 1; i < max; i++)//跳过HCanvas
     {
         var scr = scripts[i];
         if (scr.LateFrame != LateFrame)
         {
             scr.LateFrame = LateFrame;
             scr.MainUpdate();
         }
         else
         {
             Debug.Log("脚本重复更新");
         }
     }
     Collection(transform, -1, 0);
     for (int i = 0; i < top_txt; i++)
     {
         texts[i].Populate();
     }
     if (ftr)//纹理被改变了,需要重新计算
     {
         ftr = false;
         HText.DirtyAll();
         for (int i = 0; i < top_txt; i++)
         {
             texts[i].Populate();
         }
     }
     Batch();
     ApplyMeshRenderer();
     ApplyToCamera();
 }