Exemplo n.º 1
0
 private void RoundStart()
 {
     if (round == 1)
     {
         ButtonA.GetComponentInChildren <TextMeshProUGUI>().text = "Red";
         ButtonB.GetComponentInChildren <TextMeshProUGUI>().text = "Black";
     }
     else if (round == 2)
     {
         ButtonA.GetComponentInChildren <TextMeshProUGUI>().text = "High";
         ButtonB.GetComponentInChildren <TextMeshProUGUI>().text = "Low";
     }
     else if (round == 3)
     {
         ButtonA.GetComponentInChildren <TextMeshProUGUI>().text = "Outside";
         ButtonB.GetComponentInChildren <TextMeshProUGUI>().text = "Inbetween";
     }
     else if (round == 4)
     {
         ExtraButtons.SetActive(true);
         ButtonA.GetComponentInChildren <TextMeshProUGUI>().text = "Clover";
         ButtonB.GetComponentInChildren <TextMeshProUGUI>().text = "Diamond";
         ButtonC.GetComponentInChildren <TextMeshProUGUI>().text = "Spade";
         ButtonD.GetComponentInChildren <TextMeshProUGUI>().text = "Heart";
     }
 }
Exemplo n.º 2
0
    protected override void setupPattern()
    {
        string[] patternArray = new string[] { "A", "B", "X", "Y" };
        pattern = patternArray [Random.Range(0, patternArray.Length)];
        //Get First Button to highlight
        currentButton = "Button" + pattern[0];
        faceDict.TryGetValue(currentButton, out buttonValue);
        ButtonsOverlay.GetComponent <UI_Glyphs_PressThis>().faceID = buttonValue;

        //Get the animators
        AAnimator = ButtonA.GetComponent <Animator>();
        BAnimator = ButtonB.GetComponent <Animator>();
        XAnimator = ButtonX.GetComponent <Animator>();
        YAnimator = ButtonY.GetComponent <Animator>();

        //Light up the buttons contained in the pattern e.g. BABY will not light up X
        if (pattern.Contains("A"))
        {
            AAnimator.SetBool("On", true);
        }
        if (pattern.Contains("B"))
        {
            BAnimator.SetBool("On", true);
        }
        if (pattern.Contains("X"))
        {
            XAnimator.SetBool("On", true);
        }
        if (pattern.Contains("Y"))
        {
            YAnimator.SetBool("On", true);
        }
    }
Exemplo n.º 3
0
        void ReleaseDesignerOutlets()
        {
            if (BackgroundImage != null)
            {
                BackgroundImage.Dispose();
                BackgroundImage = null;
            }

            if (ButtonA != null)
            {
                ButtonA.Dispose();
                ButtonA = null;
            }

            if (ButtonB != null)
            {
                ButtonB.Dispose();
                ButtonB = null;
            }

            if (PageTitle != null)
            {
                PageTitle.Dispose();
                PageTitle = null;
            }
        }
    public void SetButtonsActive(bool active)
    {
        string on = active == true ? "on" : "off";

        ButtonA.SetActive(active);
        ButtonB.SetActive(active);
    }
Exemplo n.º 5
0
    // Start is called before the first frame update
    void Start()
    {
        A       = GameObject.Find("A");
        ButtonA = A.GetComponent <Button>();

        B       = GameObject.Find("B");
        ButtonB = B.GetComponent <Button>();

        C       = GameObject.Find("C");
        ButtonC = C.GetComponent <Button>();

        D       = GameObject.Find("D");
        ButtonD = D.GetComponent <Button>();

        head = this.transform.GetChild(0).gameObject;
        text = this.transform.GetChild(1).gameObject;

        meshH     = head.GetComponent <TextMeshProUGUI>();
        mesh      = text.GetComponent <TextMeshProUGUI>();
        mesh.text = "Question 1) What is the first step in sending data through a UDP connection for the CLIENT?";

        ButtonA.GetComponentInChildren <Text>().text = "Close the socket";
        ButtonB.GetComponentInChildren <Text>().text = "Receive the data";
        ButtonC.GetComponentInChildren <Text>().text = "Bind the socket";
        ButtonD.GetComponentInChildren <Text>().text = "Create a socket";
    }
Exemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     buAScript      = buttonA.GetComponent <ButtonA> ();
     buBScript      = buttonB.GetComponent <ButtonB> ();
     leftDoorAnima  = leftDoor.GetComponent <Animator> ();
     rightDoorAnima = rightDoor.GetComponent <Animator> ();
 }
Exemplo n.º 7
0
 void Start()
 {
     m_ButtonScriptA = m_Button_A.GetComponent <ButtonA>();
     m_ButtonScriptB = m_Button_B.GetComponent <ButtonB>();
     m_ButtonScriptC = m_Button_C.GetComponent <ButtonC>();
     m_ButtonScriptD = m_Button_D.GetComponent <ButtonD>();
     m_ButtonScriptE = m_Button_E.GetComponent <ButtonE>();
     m_ButtonScriptF = m_Button_F.GetComponent <ButtonF>();
 }
Exemplo n.º 8
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ ButtonY.GetHashCode();
         hashCode = (hashCode * 397) ^ ButtonX.GetHashCode();
         hashCode = (hashCode * 397) ^ ButtonB.GetHashCode();
         hashCode = (hashCode * 397) ^ ButtonA.GetHashCode();
         hashCode = (hashCode * 397) ^ PlusButton.GetHashCode();
         hashCode = (hashCode * 397) ^ HomeButton.GetHashCode();
         return(hashCode);
     }
 }
Exemplo n.º 9
0
 public void Update()
 {
     LeftControlStick.Update();
     RightControlStick.Update();
     ButtonA.Update();
     ButtonB.Update();
     ButtonX.Update();
     ButtonY.Update();
     ButtonLB.Update();
     ButtonRB.Update();
     ButtonL3.Update();
     ButtonR3.Update();
     ButtonBack.Update();
     ButtonStart.Update();
     LeftTrigger.Update();
     RightTrigger.Update();
     DPad.Update();
 }
 partial void ChooseB(NSObject sender)
 {
     BackgroundImage.Image = UIImage.FromFile(string.Format("{0}.jpg", ButtonB.Title(UIControlState.Normal)));
 }
Exemplo n.º 11
0
    private void GetInput()
    {
        string playerNumber = "";

        if (player == Player.P1)
        {
            playerNumber = "1";
        }
        else if (player == Player.P2)
        {
            playerNumber = "2";
        }
        else if (player == Player.P3)
        {
            playerNumber = "3";
        }

        Horizontal = Input.GetAxis("Horizontal" + playerNumber);
        if (Mathf.Abs(Horizontal) < 0.75f)
        {
            Horizontal = 0;
        }
        Vertical = -Input.GetAxis("Vertical" + playerNumber);
        if (Mathf.Abs(Vertical) < 0.75f)
        {
            Vertical = 0;
        }

        A_down = (Input.GetAxis("A" + playerNumber)) == 1;
        //Debug.Log("A_down: " + A_down);
        switch (buttonA) // Transitions
        {
        case ButtonA.A_OFF:
            if (!A_down)
            {
                buttonA = ButtonA.A_OFF; A = false;
            }
            else if (A_down)
            {
                buttonA = ButtonA.A_ON; A = true; Debug.Log("Player" + playerNumber + " A: " + A);
            }
            break;

        case ButtonA.A_ON:
            if (A_down)
            {
                buttonA = ButtonA.A_ON; A = false;
            }
            else if (!A_down)
            {
                buttonA = ButtonA.A_OFF; A = false;
            }
            break;

        default:
            buttonA = ButtonA.A_OFF;
            break;
        }
        //Debug.Log("Player" + playerNumber + " A: " + A);

        B_down = (Input.GetAxis("B" + playerNumber)) == 1;
        //Debug.Log("B_down: " + B_down);
        switch (buttonB)   // Transitions
        {
        case ButtonB.B_OFF:
            if (!B_down)
            {
                buttonB = ButtonB.B_OFF; B = false;
            }
            else if (B_down)
            {
                buttonB = ButtonB.B_ON; B = true; Debug.Log("Player" + playerNumber + " B: " + B);
            }
            break;

        case ButtonB.B_ON:
            if (B_down)
            {
                buttonB = ButtonB.B_ON; B = false;
            }
            else if (!B_down)
            {
                buttonB = ButtonB.B_OFF; B = false;
            }
            break;

        default:
            buttonB = ButtonB.B_OFF;
            break;
        }
        //Debug.Log("Player" + playerNumber + " B: " + B);

        X_down = (Input.GetAxis("X" + playerNumber)) == 1;
        //Debug.Log("X_down: " + X_down);
        switch (buttonX)   // Transitions
        {
        case ButtonX.X_OFF:
            if (!X_down)
            {
                buttonX = ButtonX.X_OFF; X = false;
            }
            else if (X_down)
            {
                buttonX = ButtonX.X_ON; X = true; Debug.Log("Player" + playerNumber + " X: " + X);
            }
            break;

        case ButtonX.X_ON:
            if (X_down)
            {
                buttonX = ButtonX.X_ON; X = false;
            }
            else if (!X_down)
            {
                buttonX = ButtonX.X_OFF; X = false;
            }
            break;

        default:
            break;
        }
        //Debug.Log("Player" + playerNumber + " X: " + X);

        Y_down = (Input.GetAxis("Y" + playerNumber)) == 1;
        //Debug.Log("Y_down: " + Y_down);
        switch (buttonY)   // Transitions
        {
        case ButtonY.Y_OFF:
            if (!Y_down)
            {
                buttonY = ButtonY.Y_OFF; Y = false;
            }
            else if (Y_down)
            {
                buttonY = ButtonY.Y_ON; Y = true; Debug.Log("Player" + playerNumber + " Y: " + Y);
            }
            break;

        case ButtonY.Y_ON:
            if (Y_down)
            {
                buttonY = ButtonY.Y_ON; Y = false;
            }
            else if (!Y_down)
            {
                buttonY = ButtonY.Y_OFF; Y = false;
            }
            break;

        default:
            buttonY = ButtonY.Y_OFF;
            break;
        }
        //Debug.Log("Player" + playerNumber + " Y: " + Y);

        LT = Input.GetAxis("LT" + playerNumber);
        if (LT > 0)
        {
            Debug.Log("LT" + playerNumber + ": " + LT);
        }

        RT = Input.GetAxis("RT" + playerNumber);
        if (RT > 0)
        {
            Debug.Log("RT" + playerNumber + ": " + RT);
        }
    }