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);
            }
        }
Esempio n. 2
0
 void OnApplicationQuit()
 {
     for (int i = 0; i < j.Count; ++i)
     {
         Joycon jc = j [i];
         jc.Detach();
     }
 }
Esempio n. 3
0
 void OnApplicationQuit()
 {
     j.Detach();
 }
Esempio n. 4
0
 void OnApplicationQuit()
 {
     j.Detach();
     Destroy(instance);
     Destroy(this);
 }