Classes and GameObjects workflow

How do you guys organize your game structure?

I am new to Unity but experienced in programming. I would do the following:

  1. For each game object have a class to manage it’s data.
  2. In an RTS game for example, each time you instantiate a unit create a new class for it and to that class pass the newly instantiated game object.

So basically you have GameObject+Class pairs for all units, correct?

GameObject is the “what you see” and the Class contains the logic for that entity.

In the RTS case, you are best of making a `prefab`. This prefab is a GameObject with scripts and everything attached to it. You then `Instantiate()` a unit from your main script. This unit will now have its own scripts.

A prefab is made by dragging a GameObject into you scene, attaching any scripts or other things to it. Then you select the GameObject in the `Hierarchy` and drag it to your `Project`