private void Awake() { //Singleton pattern if (main != null && main != this) { Destroy(gameObject); return; } main = this; }
// Start is called before the first frame update void Start() { instance = this; source = gameObject.GetComponent <AudioSource>(); }