void Awake() { if (use == null) { use = this; DontDestroyOnLoad(this.gameObject); Debug.Log("LedsControl singleton set to DontDestroyOnLoad"); } else { Debug.LogWarning("LedsControl singleton already in scene, auto-destroying"); Destroy(this); } }
private void button2_Click(object sender, EventArgs e) { LedsControl ljd = new LedsControl(); ljd.Show(); }