sawyermarchand9 / Unity2DMapGenerator

An extension to generate 2D tile maps using Perlin noise.
0 stars 0 forks source link

Fix unhandled null pointer on tilemap generation #1

Closed sawyermarchand9 closed 4 months ago

sawyermarchand9 commented 4 months ago

When a user does not select a game object for the tool, a null pointer is thrown.

Expected output: User does not select an optional game object, the tool generates the full tilemap.

Current output: User does not select an optional game object, the map generates up until the code trys to add the null game object and then a null pointer is thrown.

simple fix, handle the game object being passed in and if its null don't try to add it to the scene.

sawyermarchand9 commented 4 months ago

Null pointer is being handled now. Just need to clean up GeneratedObject parent if user does not include a game object