I have a situation where I have 2 files, File A and File B1. I then have 20 other scripts including these files. File A contains some class that are instantiated in File B.
If a variable changes within a class in File A will it change for ALL 20 scripts?
I have a very weird issue where something is updating and when I put some debug code on each point where that variable is changed, it doesn’t trigger. That is the reason for the question as it seems like one of the other 19 files including these is causing a change …
To Clarify:
I am not including a file more than once. I have 20 different scripts running separately that include the SAME file (only do it once). This is so I only need to update 1 file when I make a change and all the other files use that source. If a public var is changed within a class in that ONE file, is it changed for all the 20 files.
THanks.
Yes.
An included file is included in whatever scope it is included in.
If you include a file in the topmost scope, then it has that scope.
If you include a file via a function, then it’s scope is within that function.