void Awake() { if (instance != null) { // only one instance allowed.. throw new NotSupportedException ("Only one instance allowed"); } instance = this; }