void Awake() { //Debug.Log("Awake MidiPlayerGlobal"); if (instance != null && instance != this) { Destroy(gameObject); // remove previous instance } else { //DontDestroyOnLoad(gameObject); instance = this; instance.StartCoroutine(instance.InitThread()); } }