Shapes rendering even when the component is toggled off. Does stop rendering if the component is toggled on and then off again.
I am using shapes to draw outlines for buildings in my city builder game. When a new building is built I check to see if that building is selected and if not it turns off the outline (shapes) component however I have an issue where the rectangle is still rendered. If I then select the building in game (which turns the shapes component on) and then click off the building (which again turns off the shapes component) the outline does get turned off. I assume this is some sort of race condition issue i.e. I am turning it off after it has already started rendering the rectangle but I don't quite understand why disabling the component isn't stopping the rectangle from being rendered. It's not the end of the world as I can just turn the rectangle off on the build prefabs but ideally I can get this to work so I don't have to manually do that.