private void ShuffleRemainingJewels() { if (stopShuffle) { return; } if (GameObject.Find("Time Bomb Identification") != null) { GameObject.Find("Time Bomb Identification").GetComponent <TimeBombController> ().SetGameStarted(false); } if (!MatchPossibleCheck() && (gameObject.GetComponent <RockLevelBombHandler> ().GetBombListCount() != 0 || GameObject.Find("Jewel Collector") != null)) { Debug.Log("Ending Game From ShuffleJewels"); if (GameObject.Find("Time Bomb Identification") != null) { GameObject.Find("Time Bomb Identification").GetComponent <TimeBombController> ().SetGameStarted(false); } stopShuffle = true; touchHandler.SetGameStarted(false); checkForMatches.SetGameStarted(false); GameObject instantiatedShade = (GameObject)Instantiate(levelCompleteShade); instantiatedShade.GetComponent <DarkenOnInstantiaton> ().SetLevelComplete(false); return; } for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { if (IsJewel(instantiator.GetJewelGridGameObject(i, j)) && !swapJewel.IsASwapJewel(instantiator.GetJewelGridGameObject(i, j))) { // instantiator.GetJewelGridGameObject (i, j).rigidbody2D.isKinematic = true; DropJewel(instantiator.GetJewelGridGameObject(i, j)); movementChecker.SetGridStaticToFalse(); // AddJewelToRandomSpot (instantiator.GetJewelGridGameObject (i, j)); } } } for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { if (IsJewel(instantiator.GetJewelGridGameObject(i, j)) && !swapJewel.IsASwapJewel(instantiator.GetJewelGridGameObject(i, j))) { instantiator.InstantiateShuffledJewels(i, j); } // jewelMovement = instantiator.GetJewelGridGameObject (i, j).GetComponent<RockLevelJewelMovement> (); } } EnsureMatch(); if (GameObject.Find("Time Bomb Identification") != null) { GameObject.Find("Time Bomb Identification").GetComponent <TimeBombController> ().ResetTimestamp(); GameObject.Find("Time Bomb Identification").GetComponent <TimeBombController> ().SetGameStarted(true); } }