private void InstantiateBombSeekingHomingStar(GameObject star, GameObject jewel) { GameObject instantiatedStar = (GameObject)Instantiate(star, new Vector3(jewel.transform.position.x, jewel.transform.position.y, -49), Quaternion.identity); homingStarMovement = instantiatedStar.GetComponent <RockLevelHomingStarMovement> (); jewelMovement = jewel.GetComponent <RockLevelJewelMovement> (); GameObject randomBomb = bombHandler.GetRandomBomb(); random1 = randomBomb.GetComponent <RockLevelJewelMovement> ().GetRow(); random2 = randomBomb.GetComponent <RockLevelJewelMovement> ().GetCol(); if (instantiator.GetJewelGridGameObject(random1, random2) != null) { jewelMovement2 = instantiator.GetJewelGridGameObject(random1, random2).GetComponent <RockLevelJewelMovement> (); } while (instantiator.GetJewelGridGameObject(random1, random2) == null || (random1 == jewelMovement.GetRow() && random2 == jewelMovement.GetCol()) || checkForMatches.deleteList.Contains(instantiator.GetJewelGridGameObject(random1, random2)) || jewelMovement2.GetMoving() || !targetJewels.Add(instantiator.GetJewelGridGameObject(random1, random2))) { random1 = Random.Range(0, 9); random2 = Random.Range(0, 9); if (instantiator.GetJewelGridGameObject(random1, random2) != null) { jewelMovement2 = instantiator.GetJewelGridGameObject(random1, random2).GetComponent <RockLevelJewelMovement> (); } } homingStarMovement.SetRow(random1); homingStarMovement.SetCol(random2); homingStarMovement.SetFourInARowStar(); homingStarList.Add(instantiatedStar); }
void InstantiateTutorialTwoHomingStar(GameObject star, GameObject jewel) { GameObject instantiatedStar = (GameObject)Instantiate(star, new Vector3(jewel.transform.position.x, jewel.transform.position.y, -49), Quaternion.identity); homingStarMovement = instantiatedStar.GetComponent <RockLevelHomingStarMovement> (); jewelMovement = jewel.GetComponent <RockLevelJewelMovement> (); switch (tutorial2Count) { case 0: random1 = 7; random2 = 1; break; case 1: random1 = 6; random2 = 2; break; case 2: random1 = 5; random2 = 4; break; case 3: random1 = 1; random2 = 5; break; default: tutorialLevel2 = false; InstantiateHomingStar(star, jewel); return; } tutorial2Count++; homingStarMovement.SetRow(random1); homingStarMovement.SetCol(random2); homingStarMovement.SetFourInARowStar(); homingStarList.Add(instantiatedStar); }