Config Script. Config Script, ¿Static Class or Singleton?

Hello everyone.

I need a config script, where the designer can change global parameters in a easy way (tile size, delays and so on).

What do you recommend? A singleton or a static class? I want to add the scrit to a gameObject (and prefab) to be able to change from the unity inspector.

Thank you

If you want the script to show up in the inspector, you should probably make it a singleton (inheriting MonoBehaviour), static values don’t show up in the inspector.

Check out this awesome article with some useful tips in general, and “29. Use singletons for convenience.” specifically for your case:

http://devmag.org.za/2012/07/12/50-tips-for-working-with-unity-best-practices/

Yes, at first I though in a singleton, but in the article you mention he says “Define static properties and methods for public variables and methods that are used often from outside the class.” Anyway, I think I’m using Singleton

Thank you