How do you best describe Unity?

I’m trying to describe the overall program structure of a small game prototype I made. While in other things I tried fiddling with I have had a main class and several other classes that I can call upon for different things.

In Unity I’m having trouble describing the structure, I know that I have different objects that I’ve attached scripts to, but I’m at a loss when it comes to making a propper description on how they work together and such.

Can anyone help me try to explain this? :slight_smile:

1 Answer

1

If you’re already familiar with object-oriented design, something like Unity adds an appreciation for composition over inheritance, where you treat each entity as a colony of objects. To change the behavior of an entity, you can create a new component type (as you might do for enemy AI scripts), or add an existing component type (as you might do when adding a Rigidbody to apply physics).

Some people would call this a component-oriented system. You can also read up on the distinction between “is-a” and “has-a” relationships. Sometimes one is more convenient (this object is an enemy AI controller), sometimes the other is (this object has a physics controller). Unity allows you to use whichever method is better suited to the task at hand.

I’d recommend you learn about this over time. For now, focus on making a game that works and keep an open eye for places where refactoring might save work in future projects.