Beispiel #1
0
        public bool CalculateActiveCells(Vector3 position)
        {
            bool result = false;

            foreach (T cell in _cellList)
            {
                if (cell.cellBounds.Contains(position))
                {
                    if (!cell.isActive)
                    {
                        cell.isActive = true;
                        activeCellList.Add(cell);
                        result = true;
                    }
                }
                else
                {
                    if (cell.isActive)
                    {
                        cell.isActive = false;
                        GPUInstancerUtility.ReleaseSPCell(cell);
                        activeCellList.Remove(cell);
                        result = true;
                    }
                }
            }

            return(result);
        }