public override bool matchConditions(int xPos, int yPos, List <Board> linkedCubesX, List <Board> linkedCubesY, List <Board> linkedCubesTRBL, List <Board> linkedCubesTLBR) { int chainMatch = 0; // how many chain are making a cross... if (linkedCubesX.Count > 1) { chainMatch++; } if (linkedCubesY.Count > 1) { chainMatch++; } if (linkedCubesTLBR.Count > 1) { chainMatch++; } if (linkedCubesTRBL.Count > 1) { chainMatch++; } if (chainMatch > 1) { // + or T or L-type match special pieces gm.board[xPos, yPos].convertToSpecial(this); // makes the cube a special piece gm.board[xPos, yPos].panelHit(); //lock the piece for just created power piece gm.lockJustCreated(xPos, yPos, 0.3f); GP_TrayBasket trayBasket = FindObjectOfType <GP_TrayBasket>(); StartCoroutine(trayBasket.AddBasket(2, gm.board[xPos, yPos].position, 0)); return(true); } return(false); }
public override bool matchConditions(int xPos, int yPos, List <Board> linkedCubesX, List <Board> linkedCubesY, List <Board> linkedCubesTRBL, List <Board> linkedCubesTLBR) { if (linkedCubesY.Count > 2) { // 4 match in a row gm.board[xPos, yPos].convertToSpecial(this); // makes the cube a special piece gm.board[xPos, yPos].panelHit(); //lock the piece for just created power piece gm.lockJustCreated(xPos, yPos, 0.3f); GP_TrayBasket trayBasket = FindObjectOfType <GP_TrayBasket>(); StartCoroutine(trayBasket.AddBasket(1, gm.board[xPos, yPos].position, 0)); return(true); } return(false); }
IEnumerator TraThuong(int soluong) { for (int i = 0; i < soluong; i++) { GameObject a = Instantiate(GioTraThuong) as GameObject; yield return(new WaitForSeconds(1f)); Hashtable hh = new Hashtable(); hh.Add("x", -0.2f); hh.Add("y", -0.3f); hh.Add("time", 1f); iTween.ShakePosition(GamePanel, hh); iTween.ShakePosition(a, hh); yield return(new WaitForSeconds(1)); StartCoroutine(trayBasket.AddBasket(1, a.transform.position, 1)); Destroy(a, 1f); } }