Clean ways of setting up world data, Structs v Classes v Enums etc.

I have a project which will have units, buildings etc with lots of different attributes - lets says for starters each unit will have a Culture.

Now ideally, I want something strongly typed, but if use something as simple as an enum then I cant add extra data about the culture, like its display name, without lots of switch statements.

Whats a nice way of doing this? Any design patterns to suggest? Should I use Structs/Classes then have a class which holds pointers to them?

If you’re using the C# language, your description looks like a inheritance pattern. You have a “mother class” name “Culture” whith serveral attributes and value. Then you have some child classes wihich inherits from the mother. Take a look to the Oriented Object Programming, it may answer your question. This way of coding is exactly corresponding to what you described.

One example :

public class Culture : MonoBehaviour { 
 string m_name;
}

public class Aztec : Culture
{
 string[] m_gods;
}

public class Titan : Culture {
 float m_size;
}

I would generally use classes, that can be stored as prefabs and filled in using the inspector. This is generally a nice way to go as it really utilizes what Unity is good at. To help, I would really recommend checking out this link:

http://www.jacobpennock.com/Blog/unity-pro-tip-use-custom-made-assets-as-configuration-files/

Which is a nice tutorial on creating custom prefab types and referencing them in game. I’ve tried lots of different ways of doing it over the years (text files, big blocks of data on game objects with prefabs, etc etc) and this is the approach I’ve settled on.

-Chris