void Update() { if (!GlobalParams.isActive) { return; } if (GlobalParams.Score % 50 == 0 && GlobalParams.Score != 0 && !GlobalParams.showScoreInGame) { GlobalParams.showScoreInGame = true; GlobalParams.isActive = false; if (Gameover_Panel.gameObject.activeInHierarchy == false) { Gameover_Panel.gameObject.SetActive(true); } GlobalParams.ChangeLevel(1); scoreText.text = "თქვენ მოაგროვეთ " + GlobalParams.Score + " ქულა"; } timer -= Time.deltaTime; if (timer <= 0) { //კლონს რომ მივწვდეთ, ვაქცევთ "GameObject"-ად. if (BlnArrayIndex == BlnArr.Length - 1) { BlnArr.Shuffle(); BlnArrayIndex = 0; } else { BlnArrayIndex++; } GameObject InstanceBln = Instantiate(Blns [Random.Range(0, Blns.Count)], new Vector2(BlnArr [BlnArrayIndex], -6), Quaternion.identity) as GameObject; if (!GlobalParams.WithExample) { //მაშინ გამოვიძახოთ მაგალითიანი ბუშტი. InstanceBln.GetComponent <BallScript> ().showExample(); GenerateBtnsNumbers(); GlobalParams.BlnWithExample = InstanceBln; } timer = OldTimer; } if (GlobalParams.Passedblns == GlobalParams.Maxpassedblns && GlobalParams.isActive) { GlobalParams.isActive = false; GlobalParams.Passedblns = 0; if (Gameover_Panel.gameObject.activeInHierarchy == false) { Gameover_Panel.gameObject.SetActive(true); } GlobalParams.ChangeLevel(1); scoreText.text = "თქვენ მოაგროვეთ " + GlobalParams.Score + " ქულა"; } }
void Start() { GlobalParams.ChangeLevel(1); timer = GlobalParams.SpawnRate; OldTimer = timer; GameState = GameStates.Playng; BlnArr.Shuffle(); GameObject InstanceBln = Instantiate(Blns[Random.Range(0, Blns.Count)], new Vector2(BlnArr[BlnArrayIndex], -8), Quaternion.identity) as GameObject; }