void CleanUp() { // removes dropped controllers from list List <Joycon> rem = new List <Joycon>(); for (int i = 0; i < j.Count; i++) { Joycon v = j[i]; if (v.state == Joycon.state_.DROPPED) { if (v.other != null) { v.other.other = null; // The other of the other is the joycon itself } v.Detach(); rem.Add(v); foreach (Button b in mActivity.con) { if (b.Enabled & b.Tag == (Object)v) { b.SetBackgroundColor(Android.Graphics.Color.Gray); //= System.Drawing.Color.FromArgb(0x00, System.Drawing.SystemColors.Control); b.Enabled = false; b.SetBackgroundResource(Resource.Drawable.cross); break; } } mActivity.AppendTextBox("Removed dropped controller to list. Can be reconnected.\r\n"); } } foreach (Joycon v in rem) { j.Remove(v); } }
void OnApplicationQuit() { for (int i = 0; i < j.Count; ++i) { Joycon jc = j [i]; jc.Detach(); } }
void OnApplicationQuit() { j.Detach(); }
void OnApplicationQuit() { j.Detach(); Destroy(instance); Destroy(this); }