I’m building an app with a ton of quotes, so I’m using a dictionary to store the quotes / authors. However, now that I’ve got about 3000+ quotes, unity says:
Method loadThoughts:LoadThoughts () is too complex.
Is there a better way to include this data? In the end I’m likely to have 30,000+ entries.
We have just runned into the same issue when statically initializing huge dictionary (100k+ entries). We wanted to initialize it statically to make the load time as short as possible.
private static Dictionary<string, bool> _dict = new Dictionary<string, bool>() {
{"the_tag", true},
// 99k more entries here
};
It seems it doesn’t work with 100k in a singe dictonary, bt 10x10k dictionaries in separate classes work fine.
The solution we decided to stick to is to divide the class into a few classes and use one as a hub for accessing inner dictionaries.