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