I’m utilizing Unity Visible Scripting, and primarily utilizing 3 predominant varieties of variables:
- Graph Variables – Graph variables are native to an occasion of a script graph. They’ve the smallest scope and can’t be accessed or modified outdoors their graph.
- Object Variables – Object variables belong to a recreation object. They’re shared throughout all graphs on that recreation object.
- Scene Variables – Scene variables are shared throughout the present scene.
One factor I’ve observed is that over time, my Object Variables are filling up with quite a few variables which can be basically short-term in nature. This clutters up my Inspector, and makes it more durable to search out the vital variables I want for debugging.
For instance, I carry out detailed calculations for every Object to find out precisely the place sure shadows ought to seem. I wish to maintain the outcomes of those calculations as an Object variable, however needn’t maintain the entire intermediate variables that I used within the calculation. These intermediate variables simply clog up my Inspector.
Is there a strategy to delete unneeded variables after I not want them? Or a strategy to designate sure variables as short-term in nature?