void Awake() { mgc = cam.GetComponent<MayaGameController>(); mayaNumber = Random.Range (1, 11); setMayaNumber (); lifes = masks.Length-1; }
void Awake() { //Get the maya game controller mgc = cam.GetComponent <MayaGameController>(); //set the initial arabic number arabicNumber = Random.Range(17, 39); totalNumber.text = "" + arabicNumber; //Set the lastMaskIndex into the last maks in the array lastMaskIndex = masks.Length - 1; //Put the corresponding image into btnNumber int n = Random.Range(1, 11); //create an initial random [1,10] //create a new number if it is equal to the previous one // or is greater to the arabic number showing while (n == mayaNumber || n > arabicNumber) { //if the arabic number is less than 10 create a random [1,arabic] if (arabicNumber < 10) { n = Random.Range(1, arabicNumber + 1); } else { n = Random.Range(1, 11); //or [1,10] } } mayaNumber = n; //put the n into mayaNumber btnNumber.image.overrideSprite = numbers[mayaNumber]; //change the image to the Button }
void Awake() { for (int i = 1; i < instrucciones.Length; i++) { instrucciones [i].SetActive(false); } instrucciones [0].SetActive(true); currentInstruction = 0; mgc = cam.GetComponent <MayaGameController> (); }