Hello everyone. I would like to know what is the best way to communicate between scripts without referencing them through the inspector. I've found some very helpful answers but I'm not sure which is best and why. For example, we have a main script where all our info is saved or loaded and some secondary scripts with info. Most secondary scripts will need to use values from our main script pretty commonly and i know for sure `GetComponent` is not the best way to do it, especially if you are going to reference them a lot . I could also create a variable and then drag the game object that holds the main script to it but then i would need to do that for every single secondary script and some scripts may need to be destroyed in runtime or some game objects may change many times which i think is waste of time, which is why I'm interested in being able to make a whole class static and use it's values or perhaps use namespaces? Any help would be appreciated and sorry for the confusing, I'm really confused as well!
↧