I’m working on a 2D top down game and was thinking of generating things like trees, etc with prefab brushes.
The reason for this is the rendering. So in theory I could ensure that everything that should be in front will be rendered that way.
I can’t find any resources on how to apply the prefab brushes in the code and ended up trying this:
If what you mean by “brush” is the type of brush that’s used with the Tilemap Palette then the answer is: Palette brushes are editor only, they can’t be used in a built game or app.
If you mean something else please be more specific. It looks like you’re trying to paint a brush onto a Tilemap as a tile which isn’t possible. Doesn’t your code editor complain about a type mismatch or??
Brushes are editor-only, and in any case, is not a tile so there is no way to use it as a tile. Sorry. If you want your prefab in front of something use layers, rendering order settings, something like that.