The box in question is the one in the picture that contains Room Prefab, Item Prefab, etc. A Script’s public variables appear there. I can assign whatever values I want to just the script. This way when I assign the script to an object or prefab those values for that instance are automatically populated. But this only works when I assign the script in using the editor itself (not at run-time).
When I use AddComponent it does not automatically populate those values though. All of the values remain null and then I have to load all of the prefabs in code and it creates a nightmare of loading prefabs and passing them around unnecessarily. Can I use the information in this box dynamically?
I only ever need to assign these variables once so I have no reason to touch them at all in code.
I have no idea what it is called so I can’t google how to use it dynamically (Since I am hoping to use AddComponent). The Unity Manual doesn’t describe this box specifically as it only discusses Objects and not scripts.
While typing this I came up with a solution that I don’t like.
I could just use some conditionals in the script to prevent it from initializing anything until I am ready, then I will be free to avoid using AddComponent altogether eliminating my problem. But knowing the name of the box is still something I would like to know for future use in case I am required to use AddComponent elsewhere in a similar situation.