Example #1
0
 // Use this for initialization
 void Start()
 {
     isPressed = false;
     //interactable = true;
     //button = this;
     ButtonSpriteRenderer = this.GetComponent <SpriteRenderer> ();
     bingoCardBigScript   = GameObject.FindGameObjectWithTag("BingoCardBig").GetComponent <BingoCardBig>();
     GM_Script            = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GM>();
     SM_Script            = GameObject.FindGameObjectWithTag("SoundManager").GetComponent <SoundManagerScript>();
 }
Example #2
0
    //START Change Pattern
    public void Pattern()
    {
        if (!BingoCardBigScript)
        {
            BingoCardBigScript = GameObject.FindGameObjectWithTag("BingoCardBig").GetComponent <BingoCardBig>();
        }

        int tempNum = (int)char.GetNumericValue(tempButtonName [tempButtonName.Length - 1]);          //This is the last number on the pattern string i.e. Pattern1: where 1 is tempNum.

        if (tempButtonName == "Pattern9")
        {
            BingoCardBigScript.isCustomPattern          = true;
            BingoCardBigScript.patternIsAnimatingAcross = false;
            BingoCardBigScript.patternIsAnimatingDown   = false;
            GM_Script.patternIsAnimatingAcross          = false;
            GM_Script.patternIsAnimatingDown            = false;
            GM_Script.activePatternName = tempButtonName;

            BingoCardBigScript.ResetBingoCards();
        }
        else if (tempButtonName != "Pattern1" && tempButtonName != "Pattern2")                  //This if is to check whether the pattern will animate or not. Pattern1 and Pattern2 needs to be animated

        {
            BingoCardBigScript.isCustomPattern = false;

            //Debug.Log (tempButtonName [tempButtonName.Length - 1]-1);

            //Debug.Log (tempNum);
            //string tempPatternString = GM_Script.patternStringList [tempNum - 1];
            ConvertStringListToBool(GM_Script.patternStringList [tempNum - 1]);

            BingoCardBigScript.UpdateBingoCardSingleDisplay();

            BingoCardBigScript.patternIsAnimatingAcross = false;
            BingoCardBigScript.patternIsAnimatingDown   = false;
            GM_Script.patternIsAnimatingAcross          = false;
            GM_Script.patternIsAnimatingDown            = false;
            GM_Script.activePatternName = tempButtonName;
        }
        else
        {
            BingoCardBigScript.isCustomPattern = false;

            //Debug.Log ("This is Pattern1 or Pattern2");
            if (tempNum == 1)
            {
                BingoCardBigScript.tempMovingPattern        = GM_Script.pattern2LinesAcrossList;
                BingoCardBigScript.patternIsAnimatingAcross = true;
                GM_Script.patternIsAnimatingAcross          = true;                     //For GM and BingoCardMini
                BingoCardBigScript.patternIsAnimatingDown   = false;
                GM_Script.patternIsAnimatingDown            = false;                    //For GM and BingoCardMini
                GM_Script.coroutineHasStarted = true;                                   //For GM and BingoCardMini
                GM_Script.activePatternName   = tempButtonName;                         //For GM and BingoCardMini
                BingoCardBigScript.StartAnimDisplayAcross();
            }
            else if (tempNum == 2)
            {
                BingoCardBigScript.tempMovingPattern        = GM_Script.pattern2LinesDownList;
                BingoCardBigScript.patternIsAnimatingDown   = true;
                GM_Script.patternIsAnimatingDown            = true;                     //For GM and BingoCardMini
                BingoCardBigScript.patternIsAnimatingAcross = false;
                GM_Script.patternIsAnimatingAcross          = false;                    //For GM and BingoCardMini
                GM_Script.coroutineHasStarted = true;                                   //For GM and BingoCardMini
                GM_Script.activePatternName   = tempButtonName;                         //For GM and BingoCardMini
                BingoCardBigScript.StartAnimDisplayDown();
            }
        }

        ValidateMenuButtons(tempPattern, tempNum - 1);          //This is needed on all functions - this is to validate what is pressed, keep it pressed and unpress the others
    }