// Update is called once per frame void Update() { if (touchOn) { if (Input.GetMouseButtonDown(0)) { CheckTouch(Input.mousePosition); } if (Input.GetMouseButton(0)) { CheckTouch2(Input.mousePosition); } if (Input.GetMouseButtonUp(0) && tempPressedPauseButton != null) { CheckTouch3(Input.mousePosition); Destroy(tempPressedPauseButton); } } if (instantiateShade && GameObject.Find("Paused Shade(Clone)") == null) { if (GameObject.Find("Time Bomb Identification") != null) { GameObject.Find("Time Bomb Identification").GetComponent <TimeBombController> ().SetGameStarted(false); } GameObject.Find("Level Controller").GetComponent <RockLevelCheckForMatches> ().SetGameStarted(false); GameObject instantiatedShade = (GameObject)Instantiate(levelFailedShade); DarkenOnInstantiaton darken = instantiatedShade.GetComponent <DarkenOnInstantiaton> (); darken.SetLevelComplete(false); instantiateShade = false; } }
// Update is called once per frame void Update() { if (checkForMatches.GetGameStarted() && startLaunchingStars && bombCount > 0 && Time.time > timeStamp + cooldown) { starLaunchCount++; soundHandler.PlayStarShot(); if (starLaunchCount == 10 && bombCount >= 10) { starLaunchCount = 0; InstantiateRowDestructionStar(); scoreKeeper.IncreaseScoreByRowDestructionStar(bombCount); bombRemainderController.DecreaseBombRemainderByTen(); bombCount -= 10; } else if (starLaunchCount == 5 && bombCount >= 5) { InstantiateFallingBomb(); scoreKeeper.IncreaseScoreByFallingBomb(bombCount); bombRemainderController.DecreaseBombRemainderByFive(); bombCount -= 5; } else { InstantiateHomingStar(); scoreKeeper.IncreaseScoreByBombNumberStar(bombCount); bombRemainderController.DecreaseBombRemainderByOne(); bombCount--; } timeStamp = Time.time; } else if (startLaunchingStars && bombCount == 0 && Time.time > timeStamp + endOfLevelCooldown && stoppedMoving.GetGridStatic()) { startLaunchingStars = false; deleteJewels.SetStopFindingMatches(true); instantiatedShade = (GameObject)Instantiate(levelCompleteShade); darkenOnInstantiaton = instantiatedShade.GetComponent <DarkenOnInstantiaton> (); darkenOnInstantiaton.SetLevelComplete(true); } }