Day: May 10, 2015

  • Making a singleton in Unity

    What is a singleton? Basically, it’s code that can be used by everything else. This means you can share code between scenes in Unity. I usually use this to make sharable GUI styles. This is the basic set up: public class singleton : MonoBehaviour {     private static singleton instance;     void Awake()     {         instance = this;     } Now you can specify variables and functions here that can…