Search Unity

Using CustomBrush at Runtime?

Discussion in '2D' started by Shpendicus, Jul 3, 2020.

  1. Shpendicus

    Shpendicus

    Joined:
    Jan 12, 2018
    Posts:
    5
    Hello guys,

    in short, I am looking for a way to use my CustomBrush: GridBrush, at runtime, is this anyhow possible?

    I have found out so far by this link that its not apparently, sadly, since i thiought that it will be possible I have designed my other modules in that way, that they make use of my CustomBrush instance at runtime so that evry tile draw operation will be redirected to that brush, now I fear that I have to change that, but if this aint possible, what Can I do to archive that goal for using my extended Brush at runtiem, since their is alot of COde that is needed not also for editortime tilepaintintg but also as I said for runtime painting of tiles. Do I need to copy thatt class and redesgin that copy so that it doesnt use the GridBrush abstract class and can hence be used in Playmode enviroment?

    Pls help..

    EDIT:
    SInce when i press: "Build and Run" or go to build settigns to make a build, it doesnt allow me the use of Editorcode at runtime, since the brush needs to be apparently in Editor folder
     
    Last edited: Jul 3, 2020