public void Refresh() { this.interrupt = false; BufferList <ColliderGroup> values = this.batches.Values; for (int i = 0; i < values.Count; i++) { ColliderGroup item = values[i]; if (!item.Processing) { if (item.Count <= 0) { item.Clear(); this.DestroyColliderGroup(ref item); int num = i; i = num - 1; this.batches.RemoveAt(num); } else { item.Start(); if (item.Processing) { item.UpdateData(); item.CreateBatches(); item.RefreshBatches(); item.ApplyBatches(); item.DisplayBatches(); } item.End(); } } } }
public void Refresh() { this.interrupt = false; BufferList <ColliderGroup> values = this.batches.get_Values(); for (int index = 0; index < values.get_Count(); ++index) { ColliderGroup grp = values.get_Item(index); if (!grp.Processing) { if (grp.Count > 0) { grp.Start(); if (grp.Processing) { grp.UpdateData(); grp.CreateBatches(); grp.RefreshBatches(); grp.ApplyBatches(); grp.DisplayBatches(); } grp.End(); } else { grp.Clear(); this.DestroyColliderGroup(ref grp); this.batches.RemoveAt(index--); } } } }
public IEnumerator RefreshAsync() { this.interrupt = false; BufferList <ColliderGroup> batchGroups = this.batches.get_Values(); for (int index = 0; index < batchGroups.get_Count(); ++index) { ColliderGroup colliderGroup = batchGroups.get_Item(index); if (colliderGroup.Count > 0) { colliderGroup.Start(); } } int i; IEnumerator enumerator; for (i = 0; i < batchGroups.get_Count() && !this.interrupt; ++i) { ColliderGroup colliderGroup = batchGroups.get_Item(i); if (colliderGroup.Processing) { if (Batching.collider_threading) { enumerator = colliderGroup.UpdateDataAsync(); while (enumerator.MoveNext()) { yield return(enumerator.Current); } this.grid.ResetTimeout(); enumerator = (IEnumerator)null; } else { colliderGroup.UpdateData(); if (this.grid.NeedsTimeout) { yield return((object)CoroutineEx.waitForEndOfFrame); this.grid.ResetTimeout(); } } } } for (i = 0; i < batchGroups.get_Count() && !this.interrupt; ++i) { ColliderGroup colliderGroup = batchGroups.get_Item(i); if (colliderGroup.Processing) { colliderGroup.CreateBatches(); if (this.grid.NeedsTimeout) { yield return((object)CoroutineEx.waitForEndOfFrame); this.grid.ResetTimeout(); } } } for (i = 0; i < batchGroups.get_Count() && !this.interrupt; ++i) { ColliderGroup colliderGroup = batchGroups.get_Item(i); if (colliderGroup.Processing) { if (Batching.collider_threading) { enumerator = colliderGroup.RefreshBatchesAsync(); while (enumerator.MoveNext()) { yield return(enumerator.Current); } this.grid.ResetTimeout(); enumerator = (IEnumerator)null; } else { colliderGroup.RefreshBatches(); if (this.grid.NeedsTimeout) { yield return((object)CoroutineEx.waitForEndOfFrame); this.grid.ResetTimeout(); } } } } for (i = 0; i < batchGroups.get_Count() && !this.interrupt; ++i) { ColliderGroup batchGroup = batchGroups.get_Item(i); if (batchGroup.Processing) { for (int j = 0; j < batchGroup.TempBatches.Count && !this.interrupt; ++j) { batchGroup.TempBatches[j].Apply(); if (this.grid.NeedsTimeout) { yield return((object)CoroutineEx.waitForEndOfFrame); this.grid.ResetTimeout(); } } } batchGroup = (ColliderGroup)null; } for (int index = 0; index < batchGroups.get_Count() && !this.interrupt; ++index) { ColliderGroup colliderGroup = batchGroups.get_Item(index); if (colliderGroup.Processing) { colliderGroup.DisplayBatches(); } } for (int index = 0; index < batchGroups.get_Count(); ++index) { ColliderGroup grp = batchGroups.get_Item(index); if (grp.Processing || grp.Preserving) { grp.End(); } else if (grp.Count == 0 && !this.interrupt) { grp.Clear(); this.DestroyColliderGroup(ref grp); this.batches.RemoveAt(index--); } } }
public IEnumerator RefreshAsync() { ColliderCell colliderCell = null; int num; IEnumerator enumerator; colliderCell.interrupt = false; BufferList <ColliderGroup> values = colliderCell.batches.Values; for (int i = 0; i < values.Count; i++) { ColliderGroup item = values[i]; if (item.Count > 0) { item.Start(); } } for (num = 0; num < values.Count && !colliderCell.interrupt; num++) { ColliderGroup colliderGroup = values[num]; if (colliderGroup.Processing) { if (!Batching.collider_threading) { colliderGroup.UpdateData(); if (colliderCell.grid.NeedsTimeout) { yield return(CoroutineEx.waitForEndOfFrame); colliderCell.grid.ResetTimeout(); } } else { enumerator = colliderGroup.UpdateDataAsync(); while (enumerator.MoveNext()) { yield return(enumerator.Current); } colliderCell.grid.ResetTimeout(); enumerator = null; } } } for (num = 0; num < values.Count && !colliderCell.interrupt; num++) { ColliderGroup item1 = values[num]; if (item1.Processing) { item1.CreateBatches(); if (colliderCell.grid.NeedsTimeout) { yield return(CoroutineEx.waitForEndOfFrame); colliderCell.grid.ResetTimeout(); } } } for (num = 0; num < values.Count && !colliderCell.interrupt; num++) { ColliderGroup colliderGroup1 = values[num]; if (colliderGroup1.Processing) { if (!Batching.collider_threading) { colliderGroup1.RefreshBatches(); if (colliderCell.grid.NeedsTimeout) { yield return(CoroutineEx.waitForEndOfFrame); colliderCell.grid.ResetTimeout(); } } else { enumerator = colliderGroup1.RefreshBatchesAsync(); while (enumerator.MoveNext()) { yield return(enumerator.Current); } colliderCell.grid.ResetTimeout(); enumerator = null; } } } for (num = 0; num < values.Count && !colliderCell.interrupt; num++) { ColliderGroup item2 = values[num]; if (item2.Processing) { for (int k = 0; k < item2.TempBatches.Count && !colliderCell.interrupt; k++) { item2.TempBatches[k].Apply(); if (colliderCell.grid.NeedsTimeout) { yield return(CoroutineEx.waitForEndOfFrame); colliderCell.grid.ResetTimeout(); } } } item2 = null; } for (int l = 0; l < values.Count && !colliderCell.interrupt; l++) { ColliderGroup colliderGroup2 = values[l]; if (colliderGroup2.Processing) { colliderGroup2.DisplayBatches(); } } for (int m = 0; m < values.Count; m++) { ColliderGroup item3 = values[m]; if (item3.Processing || item3.Preserving) { item3.End(); } else if (item3.Count == 0 && !colliderCell.interrupt) { item3.Clear(); colliderCell.DestroyColliderGroup(ref item3); int num1 = m; m = num1 - 1; colliderCell.batches.RemoveAt(num1); } } }