public void SearchMatchingNeighbours() { this.inStack = true; //this.GetComponent<Animator>().enabled = true; //this.GetComponent<Animator>().SetTrigger("SimplePop"); // gameManager.tracer.Add(this.gameObject); try { if ((this.BubbleColor == Top_Left.GetComponent <BubbleProperties>().BubbleColor) && (!Top_Left.GetComponent <BubbleProperties>().inStack)) { Top_Left.GetComponent <BubbleProperties>().SearchMatchingNeighbours(); gameManager.colorMatcher.Add(Top_Left.transform); //print("TL"); //gameManager.matcher.Add() } } catch (System.Exception e) { } try { if ((this.BubbleColor == Top_Right.GetComponent <BubbleProperties>().BubbleColor) && (!Top_Right.GetComponent <BubbleProperties>().inStack)) { Top_Right.GetComponent <BubbleProperties>().SearchMatchingNeighbours(); gameManager.colorMatcher.Add(Top_Right.transform); //print("TR"); } } catch (System.Exception e) { } try { if ((this.BubbleColor == Left.GetComponent <BubbleProperties>().BubbleColor) && (!Left.GetComponent <BubbleProperties>().inStack)) { Left.GetComponent <BubbleProperties>().SearchMatchingNeighbours(); gameManager.colorMatcher.Add(Left.transform); //print("L"); } } catch (System.Exception e) { } try { if ((this.BubbleColor == Right.GetComponent <BubbleProperties>().BubbleColor) && (!Right.GetComponent <BubbleProperties>().inStack)) { Right.GetComponent <BubbleProperties>().SearchMatchingNeighbours(); gameManager.colorMatcher.Add(Right.transform); //print("R"); } } catch (System.Exception e) { } try { if ((this.BubbleColor == Bottom_Left.GetComponent <BubbleProperties>().BubbleColor) && (!Bottom_Left.GetComponent <BubbleProperties>().inStack)) { Bottom_Left.GetComponent <BubbleProperties>().SearchMatchingNeighbours(); gameManager.colorMatcher.Add(Bottom_Left.transform); //print("BL"); } } catch (System.Exception e) { } try { if ((this.BubbleColor == Bottom_Right.GetComponent <BubbleProperties>().BubbleColor) && (!Bottom_Right.GetComponent <BubbleProperties>().inStack)) { Bottom_Right.GetComponent <BubbleProperties>().SearchMatchingNeighbours(); gameManager.colorMatcher.Add(Bottom_Right.transform); //print("BR"); } } catch (System.Exception e) { } return; }
public void SearchInRadius() { this.inRadius = true; //gameManager.radiusCount++; if (gameManager.InRadiusOfExploision.Count >= 7) { return; } try { if ((!Top_Left.GetComponent <BubbleProperties>().inRadius&& !Top_Left.GetComponent <BubbleProperties>().isEmpty&& gameManager.InRadiusOfExploision.Count <= 10)) { gameManager.InRadiusOfExploision.Add(Top_Left.transform); Top_Left.GetComponent <BubbleProperties>().SearchInRadius(); } } catch (System.Exception e) { } try { if ((!Top_Right.GetComponent <BubbleProperties>().inRadius&& !Top_Right.GetComponent <BubbleProperties>().isEmpty&& gameManager.InRadiusOfExploision.Count <= 10)) { gameManager.InRadiusOfExploision.Add(Top_Right.transform); Top_Right.GetComponent <BubbleProperties>().SearchInRadius(); } } catch (System.Exception e) { } try { if ((!Left.GetComponent <BubbleProperties>().inRadius&& !Left.GetComponent <BubbleProperties>().isEmpty&& gameManager.InRadiusOfExploision.Count <= 10)) { gameManager.InRadiusOfExploision.Add(Left.transform); Left.GetComponent <BubbleProperties>().SearchInRadius(); } } catch (System.Exception e) { } try { if ((!Right.GetComponent <BubbleProperties>().inRadius&& !Right.GetComponent <BubbleProperties>().isEmpty&& gameManager.InRadiusOfExploision.Count <= 10)) { gameManager.InRadiusOfExploision.Add(Right.transform); Right.GetComponent <BubbleProperties>().SearchInRadius(); } } catch (System.Exception e) { } //try //{ // if ((!Bottom_Left.GetComponent<BubbleProperties>().inRadius && !Bottom_Left.GetComponent<BubbleProperties>().isEmpty && // gameManager.InRadiusOfExploision.Count <= 10)) // { // gameManager.InRadiusOfExploision.Add(Bottom_Left.transform); // Bottom_Left.GetComponent<BubbleProperties>().SearchInRadius(); // } //} //catch (System.Exception e) //{ //} //try //{ // if ((!Bottom_Right.GetComponent<BubbleProperties>().inRadius && !Bottom_Right.GetComponent<BubbleProperties>().isEmpty && // gameManager.InRadiusOfExploision.Count <= 10)) // { // gameManager.InRadiusOfExploision.Add(Bottom_Right.transform); // Bottom_Right.GetComponent<BubbleProperties>().SearchInRadius(); // } //} //catch (System.Exception e) //{ //} return; }