Example #1
0
        void AddBatcherToQueue(Batchable batchable)
        {
            if (batchable.GetMesh() == null)
            {
                return;
            }
            bool added = false;

            for (int i = 0; i < combineQueues.Count; i++)
            {
                if (combineQueues[i].Add(batchable))
                {
                    added = true;
                    batchable.DeactivateRenderer();
                    break;
                }
            }

            if (!added)
            {
                batchable.DeactivateRenderer();
                combineQueues.Add(new CombineChildQueue(transform, batchable.GetMaterials()));
                combineQueues[combineQueues.Count - 1].Add(batchable);
            }
        }
Example #2
0
 private bool CanAddBatcher(Batchable batcher)
 {
     if (batcher.GetMesh().vertexCount + vertexCount > 65000)
     {
         return(false);
     }
     for (int i = 0; i < materials.Length; i++)
     {
         if (materials[i] != batcher.GetMaterials()[i])
         {
             return(false);
         }
     }
     return(true);
 }