Example #1
0
 //detecta atividade do controle.
 //Vou mudar essa parte do codigo.
 void DetectActivity()
 {
     if (P2Active)
     {
         Press_A_P2.SetActive(false);
     }
     else
     {
     }
     if (P3Active)
     {
         Press_A_P3.SetActive(false);
     }
     else
     {
     }
     if (P4Active)
     {
         Press_A_P4.SetActive(false);
     }
     else
     {
     }
 }
Example #2
0
    //Ativa os controles quando apertar A.
    void ActiveJoysticks()
    {
        if (P2Connected)
        {
            if (!P2Active)
            {
                Press_A_P2.SetActive(true);
                if (Input.GetButtonDown("A P2"))
                {
                    P2Active = true;
                    SummonPlayer(2);
                }
            }

            if (P2Active)
            {
                if (Input.GetButtonDown("B P2"))
                {
                    P2Active = false;
                    Destroy(P2);
                }
            }
        }
        else
        {
            Press_A_P2.SetActive(false);
        }

        if (P3Connected)
        {
            if (!P3Active)
            {
                Press_A_P3.SetActive(true);
            }
            if (Input.GetButtonDown("A P3"))
            {
                P3Active = true;
            }
        }
        else
        {
            P3Active = false;
            Press_A_P3.SetActive(false);
        }

        if (P4Connected)
        {
            if (!P4Active)
            {
                Press_A_P4.SetActive(true);
            }
            if (Input.GetButtonDown("A P4"))
            {
                P4Active = true;
            }
        }
        else
        {
            P4Active = false;
            Press_A_P4.SetActive(false);
        }
    }