Question by
mixer468 · Jan 29 at 08:13 PM ·
gameobjectarchitecturestructureheirarchy
Returning gameobjects or component classes
What would me more advisable or better in terms of code maintenance. Say i have a method that composes the level and then i use this in my gameplay classes. I can return my level with all it's components just as a gameobject and just get components that i need with GetComponent<>(). Or do i make a level class that can provide all those components for the consumers and return it from composer method. I feel that the second option with specific class is maybe more explicit, but at the same time it feels like reinventing scene hierarchy which you already can have with gameobjects and transform.
Comment