示例#1
0
        private static void InitializeOnLoad()
        {
            MeshHelper.Init();
            MeshPool.Init();
            CombineInstanceArrayPool.Init();

            Canvas.willRenderCanvases -= Refresh;
            Canvas.willRenderCanvases += Refresh;
        }
示例#2
0
        public void Combine()
        {
            switch (count)
            {
            case 0:
                return;

            case 1:
                mesh      = combineInstances[0].mesh;
                transform = combineInstances[0].transform;
                return;

            default:
            {
                var cis = CombineInstanceArrayPool.Get(combineInstances);
                mesh = MeshPool.Rent();
                mesh.CombineMeshes(cis, true, true);
                transform = Matrix4x4.identity;
                cis.Clear();
                return;
            }
            }
        }
示例#3
0
        public static void CombineMesh(Mesh result)
        {
            if (count == 0)
            {
                return;
            }

            for (var i = 0; i < count; i++)
            {
                Profiler.BeginSample("[UIParticle] MeshHelper > Combine Mesh Internal");
                s_CachedInstance[i].Combine();
                Profiler.EndSample();
            }

            Profiler.BeginSample("[UIParticle] MeshHelper > Combine Mesh");
            var cis = CombineInstanceArrayPool.Get(s_CachedInstance, count);

            result.CombineMeshes(cis, false, true);
            cis.Clear();
            Profiler.EndSample();

            result.RecalculateBounds();
        }