public void CheckGridForMovement() { gridStatic = false; if (GameObject.Find("Time Bomb Identification") != null) { if (GameObject.Find("Time Bomb Identification").GetComponent <TimeBombController> ().GetBombsExploding()) { return; } } for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { if (instantiator.GetJewelGridGameObject(i, j) == null) { return; } jewelMovement = instantiator.GetJewelGridGameObject(i, j).GetComponent <RockLevelJewelMovement> (); if (PaidPowerTracker.GetPowerListSize() != 0 /*|| starShooter.GetBombCount () > 0 || fourInARow.GetHomingStarList ().Count > 0 || fiveInARow.GetMotherStarList ().Count > 0 || fiveInARow.GetMotherStarList ().Count > 0 || corners.GetCornerStarList ().Count > 0*/) { gridStatic = false; deleteJewels.PunchNewTimeStamp(); return; } } } if (!shuffle.GetShuffleFinished()) { shuffle.SetShuffleFinished(true); } if (noMatchChecker.CheckForNoMatches()) { gridStatic = false; deleteJewels.PunchNewTimeStamp(); return; } if (!soundController.GetGameStarted()) { soundController.SetGameStarted(true); } CheckEveryJewelForMatch(); gridStatic = true; PowerStarTracker.Clear(); }
// Update is called once per frame void Update() { if (Time.time > floatingJewelCooldown + floatingJewelTimestamp) { floatingJewelTimestamp = Time.time; if (instantiator.GetJewelGridGameObject(row, col) != gameObject && !swapJewel.IsASwapJewel(gameObject) && shuffleGameboard.GetShuffleFinished() && tag != "Slug Meal" && !jewelFalling) { Debug.Log("Destroying Floating Jewel"); Destroy(gameObject); } } if (shuffleJewel) { if (transform.position.y < -10) { Destroy(gameObject); } // if (!shufflePositionSet) { // firstTargetPosition = new Vector3 ((-2.45f + (.6125f * col)), Random.Range (3.5f, 4.5f), 0); // shufflePositionSet = true; // } // transform.Translate (new Vector3 (firstTargetPosition.x - transform.position.x, firstTargetPosition.y - transform.position.y, 0) * Time.deltaTime * 6f); // if (Mathf.Abs (firstTargetPosition.x - transform.position.x) < .005f && Mathf.Abs (firstTargetPosition.y - transform.position.y) < .005f) { // transform.position = (new Vector3 (firstTargetPosition.x, firstTargetPosition.y, ((-1 * row) - 2))); // rigidbody2D.isKinematic = false; // shuffleJewel = false; // shufflePositionSet = false; // } } // if (destroyJewelCountdown && Time.time >= timeStamp + cooldown) { // //Debug.Log ("DESTROYING FLOATING JEWEL"); // Destroy (gameObject); // } }