Closed Gard-en closed 1 year ago
Set clear radius to use float serializedfield for ease of modification.
Doing it in a function was too expensive, moved to IEnumerator and unset tiles every frame instead of all at once.
Map cleanup causing some FPS spikes, going to try and optimize or slow the code execution down to reduce chug time.
The below shows the logic behind the initial spawner spawn logic. It doubled every 15 seconds, which is why after 2:30 minutes, the code had executed 8 times, resulting in 256 spawners all running their own code.
Now it's just a random number of spawners between 1 and 5. Fixed.
As enemies are getting stuck on world props when spawning in, we need a way to remove world props when a portal spawns in.
My solution to this is to do a 2D raycast when a portal spawns in. It detects tiles and props within a certain radius and destroys them if they're found, reducing the risk of enemies getting stuck when spawning in.
This also tidies up the map considerably during the late-game stage when portals form a sort of maze around the central tower.