- Home /
I have a lot of references
This is more of a best practices question. I'm developing the menu system for my game right now, and find myself needing to add a lot of references to panels, text objects, button, etc.. in the script. I'm doing this by creating a public field, then dragging and dropping it from the object hierarchy. I'm new to unity development, but not C# development in general so this practice leaves me uneasy, it feels kind of messy. So my question is, is this the best way to do it? I know about GetComponent, but that doesn't seem much better, and I read that it's slower. I'm not concerned about the inspector getting to unwieldy, just that I might be missing a better way. Thanks.
Your answer
Follow this Question
Related Questions
How to affect a group of objects. 1 Answer
Is there any way to reference the object that a raycast hits 1 Answer
Position of Instantiated Objects from a reference 1 Answer
Using accessors and mutators from another class 2 Answers
how to reference a list that is inside a scriptable object class from a monobehaviour 1 Answer