private void Start()
 {
     sB       = FindObjectOfType <SelectButton>();
     bGI      = FindObjectOfType <BoardGestureInput>();
     btn      = null;
     selected = true;
 }
예제 #2
0
 private void Start()
 {
     audioSource = GetComponent<AudioSource>();
     nRS = FindObjectOfType<NumberReaderScript>();
     sB = FindObjectOfType<SelectButton>();
     bGI = FindObjectOfType<BoardGestureInput>();
 }
예제 #3
0
 private void Start()
 {
     bGI = FindObjectOfType <BoardGestureInput>();
     bTR = FindObjectOfType <BetTypeReader>();
 }
예제 #4
0
    //All the gestures for the betting panel
    public void Gestures(string type)
    {
        //Confirms bet
        if (type == "DoubleClick")
        {
            if (balance.text != "0")
            {
                if (source == null)
                {
                    bGI = FindObjectOfType <BoardGestureInput>();
                    bGI.SetFirst();
                    confirm.onClick.Invoke();
                }

                else
                {
                    if (amount.text == "100")
                    {
                        bGI = FindObjectOfType <BoardGestureInput>();
                        bGI.SetFirst();
                        confirm.onClick.Invoke();
                    }

                    else
                    {
                        if (!narrator.isPlaying)
                        {
                            source.Play();
                        }
                    }
                }
            }
        }

        //Plays balance
        else if (type == "Click")
        {
            if (!narrator.isPlaying && !amountReader.isPlaying)
            {
                balance.GetComponentInParent <Button>().onClick.Invoke();
            }
        }

        //Changes amount
        else if (type.Contains("Swipe"))
        {
            if (bPT == null)
            {
                bPT = gameObject.GetComponent <BetPanelTimer>();
            }

            bPT.CallTimer();

            string temp = Regex.Replace(balance.text, "[^.0-9]", "");

            int am = int.Parse(amount.text);

            int bal = int.Parse(temp);

            if (type.Contains("Up"))
            {
                if (am + 100 <= bal)
                {
                    am += 100;
                }

                else
                {
                    am = bal;
                }

                amount.text = am.ToString();
            }

            else if (type.Contains("Down"))
            {
                if (am - 100 >= 10)
                {
                    am -= 100;
                }

                else
                {
                    am = 10;
                }

                amount.text = am.ToString();
            }

            else if (type.Contains("Left"))
            {
                if (am - 10 >= 10)
                {
                    am         -= 10;
                    amount.text = am.ToString();
                }
            }

            else if (type.Contains("Right"))
            {
                if (am + 10 <= bal)
                {
                    am         += 10;
                    amount.text = am.ToString();
                }
            }
        }
    }