Пример #1
0
    public void CheckForOldSeeds(Vector2 playerPos)
    {
        for (int i = 0; i < ActiveSeeds.Count; i++)
        {
            Vector2 center = ActiveSeeds.ElementAt(i).Value;
            if (playerPos.x < center.x + (c_Width * threshold) && playerPos.x > center.x - (c_Width * threshold) && playerPos.y < center.y + (c_Height * threshold) && playerPos.y > center.y - (c_Height * threshold))
            {
            }
            else
            {
                int key = ActiveSeeds.ElementAt(i).Key;
                //Seed is out of bounds, do all destroying here.
                t_Factory.DeactivateChunk(key);

                w_Factory.RemoveObjectsFromChunk(key);

                ActiveSeeds.Remove(key);
            }
        }
    }