feat: un-limit on the number of mesh instances

This commit is contained in:
mob-sakai
2020-10-28 00:39:22 +09:00
parent 4be56669fb
commit f1338813ca
4 changed files with 81 additions and 33 deletions

View File

@@ -6,12 +6,13 @@ namespace Coffee.UIParticleExtensions
{
internal static class MeshHelper
{
public static long activeMeshIndices { get; private set; }
public static List<bool> activeMeshIndices { get; private set; }
private static readonly List<CombineInstanceEx> s_CachedInstance;
private static int count;
public static void Init()
{
activeMeshIndices = new List<bool>();
}
static MeshHelper()
@@ -64,13 +65,13 @@ namespace Coffee.UIParticleExtensions
inst.Push(mesh, transform);
Profiler.EndSample();
activeMeshIndices |= (long) 1 << inst.index;
activeMeshIndices[inst.index] = true;
}
public static void Clear()
{
count = 0;
activeMeshIndices = 0;
activeMeshIndices.Clear();
foreach (var inst in s_CachedInstance)
{
inst.Clear();