Ejemplo n.º 1
0
    private IEnumerator UpdateCoroutine()
    {
label_1:
        do
        {
            yield return((object)CoroutineEx.waitForEndOfFrame);
        }while (Application.isReceiving != null || Application.isLoading != null || (ColliderGrid.Paused || this.grid == null));
        this.ResetTimeout();
        for (int x = 0; x < this.grid.CellCount; ++x)
        {
            for (int z = 0; z < this.grid.CellCount; ++z)
            {
                ColliderCell colliderCell = this.grid.get_Item(x, z);
                if (colliderCell.NeedsRefresh())
                {
                    IEnumerator enumerator = colliderCell.RefreshAsync();
                    while (enumerator.MoveNext())
                    {
                        yield return(enumerator.Current);
                    }
                    enumerator = (IEnumerator)null;
                }
                if (this.NeedsTimeout)
                {
                    yield return((object)CoroutineEx.waitForEndOfFrame);

                    this.ResetTimeout();
                }
            }
        }
        goto label_1;
    }
Ejemplo n.º 2
0
    private IEnumerator UpdateCoroutine()
    {
        ColliderGrid colliderGrid = null;

        while (true)
        {
            yield return(CoroutineEx.waitForEndOfFrame);

            if (!Rust.Application.isReceiving && !Rust.Application.isLoading && !ColliderGrid.Paused && colliderGrid.grid != null)
            {
                colliderGrid.ResetTimeout();
                for (int i = 0; i < colliderGrid.grid.CellCount; i++)
                {
                    for (int j = 0; j < colliderGrid.grid.CellCount; j++)
                    {
                        ColliderCell item = colliderGrid.grid[i, j];
                        if (item.NeedsRefresh())
                        {
                            IEnumerator enumerator = item.RefreshAsync();
                            while (enumerator.MoveNext())
                            {
                                yield return(enumerator.Current);
                            }
                            enumerator = null;
                        }
                        if (colliderGrid.NeedsTimeout)
                        {
                            yield return(CoroutineEx.waitForEndOfFrame);

                            colliderGrid.ResetTimeout();
                        }
                    }
                }
            }
        }
    }