I have a static class with a bool which I would like to set to true/false based on an Editor Script…
i.e. I have this in a class…
public static bool Toggle = true;
I want to be able to use an Editor script to add a menu to toggle it to true or false depending on which is clicked… I can do the menu part that’s easy, it’s just the changing the actual code part…
Not quite sure where to look for how to inject code into a file… Is this even possible?
To locate your file just look for it at the Application.dataPath recursively, or use relative to Application.dataPath path if file location is constant.