Hi everyone, so I thought this game needed a shop mechanic or some way to sell a defender for whatever reason so I came up with this idea…(you can use it commercially)
Instructions:
1: Okay, so in my case, I downloaded this asset to have a sprite as the actual shop, you can use it or not… link: https://www.glitchthegame.com/inhabitants/vendors/meal-vendor/ (you can also animate it as the scene loads or something but the idle_stand will do for this)
2: What I did was place the background of the buttons at 3.5x and 6y and then put the shop to the left of the buttons with a trigger BoxCollider2D, a new script called ShopSelling (and a child with the sprite renderer for some possible future animating).
3: Make sure you put this in the defender script. (Github link)
https://gist.github.com/anonymous/8069d3ffdf861146514be3407fb59120
4: This is the script attached to the shop GameObject. (Github link)
https://gist.github.com/anonymous/30bc13af143d536aebf7b9412745c3a8